def _formatXml(root):
 for elem in root.getiterator():
  if ((len(elem) > 0) and ((not elem.text) or (not elem.text.strip()))):
   elem.text = '\n'
  if ((not elem.tail) or (not elem.tail.strip())):
   elem.tail = '\n'

def _formatXml ( root ) : for elem in root . getiterator ( ) : if ( ( len ( elem ) > 0 ) and ( ( not elem . text ) or ( not elem . text . strip ( ) ) ) ) : elem . text = '\n' if ( ( not elem . tail ) or ( not elem . tail . strip ( ) ) ) : elem . tail = '\n'
a helper to make the lrs output look nicer .