def __init__(self, element, from_jid = None, to_jid = None,<EOL>stanza_type = None, stanza_id = None,<EOL>error = None, error_cond = None,<EOL>return_path = None, language = None):
<EOL>self._error = None<EOL>self._from_jid = None<EOL>self._to_jid = None<EOL>self._stanza_type = None<EOL>self._stanza_id = None<EOL>self._language = language<EOL>if isinstance(element, ElementClass):<EOL><INDENT>self._element = element<EOL>self._dirty = False<EOL>self._decode_attributes()<EOL>if not element.tag.startswith("<STR_LIT:{>"):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>self._namespace, self.element_name = element.tag[<NUM_LIT:1>:].split("<STR_LIT:}>")<EOL>if self._namespace not in STANZA_NAMESPACES:<EOL><INDENT>raise BadRequestProtocolError("<STR_LIT>")<EOL><DEDENT><DEDENT>self._payload = None<EOL><DEDENT>else:<EOL><INDENT>self._element = None<EOL>self._dirty = True<EOL>self.element_name = unicode(element)<EOL>self._namespace = STANZA_CLIENT_NS<EOL>self._payload = []<EOL><DEDENT>self._ns_prefix = "<STR_LIT>".format(self._namespace)<EOL>self._element_qname = self._ns_prefix + self.element_name<EOL>if from_jid is not None:<EOL><INDENT>self.from_jid = from_jid<EOL><DEDENT>if to_jid is not None:<EOL><INDENT>self.to_jid = to_jid<EOL><DEDENT>if stanza_type:<EOL><INDENT>self.stanza_type = stanza_type<EOL><DEDENT>if stanza_id:<EOL><INDENT>self.stanza_id = stanza_id<EOL><DEDENT>if self.stanza_type == "<STR_LIT:error>":<EOL><INDENT>if error:<EOL><INDENT>self._error = StanzaErrorElement(error)<EOL><DEDENT>elif error_cond:<EOL><INDENT>self._error = StanzaErrorElement(error_cond)<EOL><DEDENT>else:<EOL><INDENT>self._decode_error()<EOL><DEDENT><DEDENT>if return_path is not None:<EOL><INDENT>self._return_path = weakref.ref(return_path)<EOL><DEDENT>
Initialize a Stanza object.

        :Parameters:
            - `element`: XML element of this stanza, or element name for a new
              stanza. If element is given it must not be modified later,
              unless `decode_payload()` and `mark_dirty()` methods are called
              first (the element changes won't affec the stanza then).
            - `from_jid`: sender JID.
            - `to_jid`: recipient JID.
            - `stanza_type`: staza type: one of: "get", "set", "result" or
              "error".
            - `stanza_id`: stanza id -- value of stanza's "id" attribute. If
              not given, then unique for the session value is generated.
            - `error`: error object. Ignored if `stanza_type` is not "error".
            - `error_cond`: error condition name. Ignored if `stanza_type` is
              not "error" or `error` is not None.
            - `return_path`: route for sending responses to this stanza. Will
              be weakly referenced.
            - `language`: default language for the stanza content
        :Types:
            - `element`: `unicode` or :etree:`ElementTree.Element`
            - `from_jid`: `JID`
            - `to_jid`: `JID`
            - `stanza_type`: `unicode`
            - `stanza_id`: `unicode`
            - `error`: `pyxmpp.error.StanzaErrorElement`
            - `error_cond`: `unicode`
            - `return_path`: `StanzaRoute`
            - `language`: `unicode`