The xml.dom package also includes various helper classes for various common tasks that are often performed on DOM trees.
One example is the Walker class in the xml.dom.walker module. It will most often be used by overriding specific methods which are called for the most significant node types: doText() for Text nodes, doComment() for comments, startElement() and endElement() for Element nodes, and doOtherNode() for all other types of DOM nodes.
XXX need a walking example