You can use xml.etree.ElementTree which is included with Python. There is an included companion C-implemented (i.e. much faster) xml.etree.cElementTree
. lxml.etree
offers a superset of the functionality but it's not needed for what you want to do.
The code provided by @Acorn works identically for me (Python 2.7, Windows 7) with each of the following imports:
import xml.etree.ElementTree as et
import xml.etree.cElementTree as et
import lxml.etree as et
...
tree = et.fromstring(xmltext)
...
What OS are you using and what installation problems have you had with lxml
?