indent_xml

wwt_data_formats.indent_xml(elem, level=0)[source]

A dumb XML indenter.

We create XML files using xml.etree.ElementTree, which is careful about spacing and so by default creates ugly files with no linewraps or indentation. This function is copied from ElementLib (formerly found at http://effbot.org/zone/element-lib.htm#prettyprint, currently offline) and implements basic, sensible indentation using “tail” text.