many revisions to transition from xml.dom.minidom to lxml