Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
XML Pretty Print
import xml.dom.minidom
import sys
input =
dom = xml.dom.minidom.parseString(input)
pretty_xml_as_string = dom.toprettyxml(indent=' ', newl='\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.