I have an XML document which reads like this:
4000 0 <
This is an old question but somebody might not know that at least BeautifulSoup 4 does handle namespaces well if you pass 'xml' as second argument to the constructor:
'xml'
soup = BeautifulSoup(""" 4000 0 """, 'xml') print soup.prettify() 4000 0