{
TestFailure failure = new TestFailure(theTest, theThrowable);
StringBuffer xml = new StringBuffer();
xml.append("<" + ERROR + " " + ATTR_MESSAGE + "=\""
+ xmlEncode(failure.thrownException().getMessage()) + "\" "
+ ATTR_TYPE + "=\""
+ failure.thrownException().getClass().getName() + "\">");
xml.append(xmlEncode(StringUtil.exceptionToString(
failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS)));
xml.append("</" + ERROR + ">");