def METHOD_NAME(name, stats):
    el = create_testcase(name)
    text = "\n".join(["%s=%s" % (key, value) for (key, value) in stats.items()])
    build_stats = root.createCDATASection("\n%s\n" % text)
    system_out = root.createElement("system-out")
    el.appendChild(system_out)
    el.lastChild.appendChild(build_stats)
    return el