def remove_comments(xml):
regex = re.compile(r'<STR_LIT>', re.DOTALL)<EOL>return regex.sub('<STR_LIT>', xml)<EOL>
Remove comments, as they can break the xml parser.

See html5lib issue #122 ( http://code.google.com/p/html5lib/issues/detail?id=122 ).

>>> remove_comments('<!-- -->')
''
>>> remove_comments('<!--\\n-->')
''
>>> remove_comments('<p>stuff<!-- \\n -->stuff</p>')
'<p>stuffstuff</p>'