code: def _tree_to_string(cls, root_element, xml_declaration=True, pretty_print=True):
          
          from lxml import etree
          return gf.safe_unicode(etree.tostring(
              root_element,
              encoding="UTF-8",
              method="xml",
              xml_declaration=xml_declaration,
              pretty_print=pretty_print
          ))
docs: Return an ``lxml`` tree as a Unicode string.