I'm a little nervous about parsing XML with regex because maintenance can be a hassle, and it doesn't always address encoding issues.  We have a built-in standard version of ElementTree available from <code>virttest.xml_utils.ElementTree<code>.  Though you may find that <code>xml_utils.XMLTreeFile</code> subclass is a little easier to use.   The etree parser is very easy to work with, it just encodes XML as python lists-of-lists and dicts. Docs and examples are available here: http://docs.python.org/release/2.6.8/library/xml.etree.elementtree.html#module-xml.etree.ElementTree

Let me know if you have any trouble with it, I have a lot of experience working with ElemetTree.