def element_content_as_string(element):
if len(element) == <NUM_LIT:0>:<EOL><INDENT>return element.text or "<STR_LIT>"  <EOL><DEDENT>stream = compat.StringIO()<EOL>for childnode in element:<EOL><INDENT>stream.write(xml_to_bytes(childnode, pretty_print=False) + "<STR_LIT:\n>")<EOL><DEDENT>s = stream.getvalue()<EOL>stream.close()<EOL>return s<EOL>
Serialize etree.Element.

    Note: element may contain more than one child or only text (i.e. no child
          at all). Therefore the resulting string may raise an exception, when
          passed back to etree.XML().