def _from_xml(self, element):
<EOL>if element.tag != self.error_qname:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>element, self.error_qname))<EOL><DEDENT>lang = element.get(XML_LANG_QNAME, None)<EOL>if lang:<EOL><INDENT>self.language = lang<EOL><DEDENT>self.condition = None<EOL>for child in element:<EOL><INDENT>if child.tag.startswith(self.cond_qname_prefix):<EOL><INDENT>if self.condition is not None:<EOL><INDENT>logger.warning("<STR_LIT>")<EOL>continue<EOL><DEDENT>self.condition = deepcopy(child)<EOL><DEDENT>elif child.tag == self.text_qname:<EOL><INDENT>lang = child.get(XML_LANG_QNAME, None)<EOL>if lang:<EOL><INDENT>self.language = lang<EOL><DEDENT>self.text = child.text.strip()<EOL><DEDENT>else:<EOL><INDENT>bad = False<EOL>for prefix in (STREAM_QNP, STANZA_CLIENT_QNP, STANZA_SERVER_QNP,<EOL>STANZA_ERROR_QNP, STREAM_ERROR_QNP):<EOL><INDENT>if child.tag.startswith(prefix):<EOL><INDENT>logger.warning("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>bad = True<EOL>break<EOL><DEDENT><DEDENT>if not bad:<EOL><INDENT>self.custom_condition.append( deepcopy(child) )<EOL><DEDENT><DEDENT><DEDENT>if self.condition is None:<EOL><INDENT>self.condition = ElementTree.Element(self.cond_qname_prefix<EOL>+ "<STR_LIT>")<EOL><DEDENT>if self.condition.tag in OBSOLETE_CONDITIONS:<EOL><INDENT>new_cond_name = OBSOLETE_CONDITIONS[self.condition.tag]<EOL>self.condition = ElementTree.Element(new_cond_name)<EOL><DEDENT>
Initialize an ErrorElement object from an XML element.

        :Parameters:
            - `element`: XML element to be decoded.
        :Types:
            - `element`: :etree:`ElementTree.Element`