Code: Alles auswählen
from xml.dom import minidom
#geht
print minidom.parseString("<foo1></foo1>").toprettyxml()
#geht
print minidom.parseString("<foo2></foo2>").toprettyxml()
#geht nicht
print minidom.parseString("<foo1></foo1><foo2></foo2>").toprettyxml()