def stanza_factory(element, return_path = None, language = None):
tag = element.tag<EOL>if tag.endswith("<STR_LIT>") or tag == "<STR_LIT>":<EOL><INDENT>return Iq(element, return_path = return_path, language = language)<EOL><DEDENT>if tag.endswith("<STR_LIT>") or tag == "<STR_LIT:message>":<EOL><INDENT>return Message(element, return_path = return_path, language = language)<EOL><DEDENT>if tag.endswith("<STR_LIT>") or tag == "<STR_LIT>":<EOL><INDENT>return Presence(element, return_path = return_path, language = language)<EOL><DEDENT>else:<EOL><INDENT>return Stanza(element, return_path = return_path, language = language)<EOL><DEDENT>
Creates Iq, Message or Presence object for XML stanza `element`

    :Parameters:
        - `element`: the stanza XML element
        - `return_path`: object through which responses to this stanza should
          be sent (will be weakly referenced by the stanza object).
        - `language`: default language for the stanza
    :Types:
        - `element`: :etree:`ElementTree.Element`
        - `return_path`: `StanzaRoute`
        - `language`: `unicode`