def _dump_element(elem, indent=''):
 s = ("%selement '%s': %s" % (indent, elem.tag, elem.attrib))
 print s
 for child in elem:
  _dump_element(child, (indent + '  '))

def _dump_element ( elem , indent = '' ) : s = ( "%selement '%s': %s" % ( indent , elem . tag , elem . attrib ) ) print s for child in elem : _dump_element ( child , ( indent + '  ' ) )
dump an element tree without using et .