A port of the perl scripts found at http://etree-scripts.sourceforge.net