XML Python

from xml.dom import minidom
contents = "

0

1

" 
xmldoc = minidom.parseString(contents)             
print xmldoc.toxml()