code: def prettyXml(elem):
      
      roughString = ET.tostring(elem, "utf-8")
      reparsed = minidom.parseString(roughString)
      return reparsed.toprettyxml(indent="  ")
docs: Return a pretty-printed XML string for the ElementTree Element.