def to_string(xml, **kwargs):
        """
        Serialize an element to an encoded string representation of its XML tree.
        :param xml: The root node
        :type xml: str|bytes|xml.dom.minidom.Document|etree.Element
        :returns: string representation of xml
        :rtype: string
        """

        if isinstance(xml, OneLogin_Saml2_XML._text_class):
            return xml

        if isinstance(xml, OneLogin_Saml2_XML._element_class):
            OneLogin_Saml2_XML.cleanup_namespaces(xml)
            return OneLogin_Saml2_XML._unparse_etree(xml, **kwargs)

        raise ValueError("unsupported type %r" % type(xml))
def to_string ( xml , ** kwargs ) : if isinstance ( xml , OneLogin_Saml2_XML . _text_class ) : return xml if isinstance ( xml , OneLogin_Saml2_XML . _element_class ) : OneLogin_Saml2_XML . cleanup_namespaces ( xml ) return OneLogin_Saml2_XML . _unparse_etree ( xml , ** kwargs ) raise ValueError ( "unsupported type %r" % type ( xml ) )
Serialize an element to an encoded string representation of its XML tree.
        :param xml: The root node
        :type xml: str|bytes|xml.dom.minidom.Document|etree.Element
        :returns: string representation of xml
        :rtype: string