You can also try using beautifulstonesoup, may be more robust. If it parses successfully, then you can use it to serialize back to xml which should fix the problems for lxml.
But before doing so you will have to give it a list of the self closing tags.
|