from xml.dom import minidomcontents = "<grammar><ref id='bit'><p>0</p><p>1</p></ref></grammar>" xmldoc = minidom.parseString(contents) print xmldoc.toxml()
Name (required)
email (will not be published) (required)
Website