Rewrite XML parsing with minidom

This is because fc895fe8bfe6f864c190a62f437bb6271fe4f678 does not expose
_Element anymore.