Modernize and add python3 support
This had a dependency on PyXML, which does not support python3 (actually does not even support python2.7 byt we have been using a patched version). To drop this dependency, we use lxml sax interface directly.
Modernize several things:
- enable the doctest
- use lxml xml comparison to compare XML
- use python3 compatible syntax