def indent(elem, level=<NUM_LIT:0>):
XMLindentation = "<STR_LIT:U+0020>" <EOL>i = "<STR_LIT:\n>" + level * XMLindentation<EOL>if len(elem):<EOL><INDENT>if not elem.text or not elem.text.strip():<EOL><INDENT>elem.text = i + XMLindentation<EOL><DEDENT>for e in elem:<EOL><INDENT>indent(e, level+<NUM_LIT:1>)<EOL>if not e.tail or not e.tail.strip():<EOL><INDENT>e.tail = i + XMLindentation<EOL><DEDENT><DEDENT>if not e.tail or not e.tail.strip():<EOL><INDENT>e.tail = i<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if level and (not elem.tail or not elem.tail.strip()):<EOL><INDENT>elem.tail = i<EOL><DEDENT><DEDENT>
adds whitespace to the tree, so that it results in a pretty printed tree