import xml.dom.minidom document = xml.dom.minidom.parseString(""" ] > Don't let entities make you frown ⌣ """.strip()) document.cloneNode(deep=True)