Refactor and recursive append minidom to elementtree, and clean up old code in tests.