def serialize(element):
if getattr(_THREAD, "<STR_LIT>", None) is None:<EOL><INDENT>_THREAD.serializer = XMPPSerializer("<STR_LIT>")<EOL>_THREAD.serializer.emit_head(None, None)<EOL><DEDENT>return _THREAD.serializer.emit_stanza(element)<EOL>
Serialize an XMPP element.

    Utility function for debugging or logging.

        :Parameters:
            - `element`: the element to serialize
        :Types:
            - `element`: :etree:`ElementTree.Element`

        :Return: serialized element
        :Returntype: `unicode`