the xml cleanup patch was not Python 3 friendly
Moved XML cleanup functions to util.py.  This seems like a better idea.