parentNode.insertBefore(doc.createComment(element.toxml()), element)
parentNode.removeChild(element)
f = open(myXmlFile, 'w')
f.write(doc.toxml())
f.close()
How to comment out an XML Element (using minidom DOM implementation)