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

def xml_element(self):

    testcase = ET.Element('testcase')
    testcase.set('classname', self.classname)
    testcase.set('name', self.name)
    testcase.set('time', str(self.time))
    for f in self.failures:
        testcase.append(f.xml_element())
    for e in self.errors:
        testcase.append(e.xml_element())
    return testcase
