def _process_element(self, element):
tag = element.tag<EOL>if tag in self._element_handlers:<EOL><INDENT>handler = self._element_handlers[tag]<EOL>logger.debug("<STR_LIT>"<EOL>.format(element, handler))<EOL>handled = handler(self, element)<EOL>if handled:<EOL><INDENT>return<EOL><DEDENT><DEDENT>if tag.startswith(self._stanza_namespace_p):<EOL><INDENT>stanza = stanza_factory(element, self, self.language)<EOL>self.uplink_receive(stanza)<EOL><DEDENT>elif tag == ERROR_TAG:<EOL><INDENT>error = StreamErrorElement(element)<EOL>self.process_stream_error(error)<EOL><DEDENT>elif tag == FEATURES_TAG:<EOL><INDENT>logger.debug("<STR_LIT>".format(serialize(element)))<EOL>self._got_features(element)<EOL><DEDENT>else:<EOL><INDENT>logger.debug("<STR_LIT>".format(serialize(element)))<EOL>logger.debug("<STR_LIT>".format(<EOL>self._element_handlers))<EOL><DEDENT>
Process first level element of the stream.

        The element may be stream error or features, StartTLS
        request/response, SASL request/response or a stanza.

        :Parameters:
            - `element`: XML element
        :Types:
            - `element`: :etree:`ElementTree.Element`