'Append an XML tag with information from a failure or error to the
supplied testcase.'

def _print_error(self, testcase, tagname, error):

    tag = ET.SubElement(testcase, tagname)
    tag.set('type', str(error[0].__name__))
    tb_stream = StringIO()
    traceback.print_tb(error[2], None, tb_stream)
    tag.text = ('%s\n%s' % (str(error[1]), tb_stream.getvalue()))
