AskXML Run SQL statements on XML documents It's WIP (missing tests and documentation), but you can take a look at how it works in test.py & test.xml.