Personally, when possible, I started with elementtree (preferably the C implementation that comes with the standard Python library, or lxml , but this is only important for higher speed). This is not a standard DOM, but contains the same information in a more Pythonic and convenient way. You can start with a call xml.etree.ElementTree.parsethat takes an XML source and returns a tree of elements; do this in both sources, use getrootfor each tree of elements to get its root element, and then recursively compare the elements, starting from the root.
, , DOM, , ; Python ( " ", , ) . , .
- , DOM, , , DOM , ?
, PyRXP, , ElementTree. ; , PyRXP lxml cElementTree.