def stringify_children(node):
 parts = [node.text]
 for c in node.getchildren():
  parts.append(etree.tostring(c, with_tail=True, encoding='unicode'))
 return u''.join(filter(None, parts))

def stringify_children ( node ) : parts = [ node . text ] for c in node . getchildren ( ) : parts . append ( etree . tostring ( c , with_tail = True , encoding = 'unicode' ) ) return u'' . join ( filter ( None , parts ) )
return all contents of an xml tree .