#!/usr/bin/env python3 import xml.dom.minidom import sys doc = xml.dom.minidom.parse(sys.stdin) doc.writexml(sys.stdout, addindent=" ", newl="\n")