def METHOD_NAME(test_case):
    element = ET.Element("failure")
    if test_case.message:
        element.set("message", test_case.message)
    if test_case.stdout:
        element.text = test_case.stdout
    return element