I've found the same bug. This is what I've been doing: from xml.dom.minidom import Document
try: from xml.dom.ext import PrettyPrint except ImportError: PrettyPrint = None doc = Document() ... if PrettyPrint is not None: PrettyPrint(doc, stream=output, indent=' ') else: top_parent.setAttribute("xmlns", xmlns) output.write(doc.toprettyxml(indent=' ')) -- http://mail.python.org/mailman/listinfo/python-list