from xml.dom import minidomcontents = "01" xmldoc = minidom.parseString(contents) print xmldoc.toxml()
0
1