The tree parser Interface


import libxml2
doc = libxml2.parseFile("ex1.xml")
p = doc.children
print p.name
doc.freeDoc()

See example 1, XML