So that I don't forget... again.
from xml.dom import minidom
# from a string
minidom.parseString(xml_string).toprettyxml(indent=' '*4)
# or from a file
minidom.parse(open(xml_file)).toprettyxml(indent=' '*4)
And for the record...
import simplejson as json
json.dumps(json_obj, indent=4)