'@return XML tag representing the object, with non-XML text filtered out
@rtype: xml.etree.ElementTree.Element'

def xml_element(self):

    error = ET.Element('failure')
    error.set('type', self.type)
    error.text = cdata(filter_nonprintable_text(self.text))
    return error
