ported XML parsing from libxml2 to Python's builtin xml.dom.minidom to reduce dependenies