def createAggregatedTestCase(doc, parent_node, testclass_name):
    """
    Create a node which represents a single aggregated testcase.
    Aggregated testcase sums the result of all test cases that
    belong to the speified classname. If one of these test cases
    fails, the aggregated test case's status is set to failed.
    """
    testcase = doc.createElement('testcase')
    # This holds the complete test id.
    testcase.setAttribute('classname', testclass_name)
    # classname holds the whole test id already, so the 'name'
    # attribute holds just a persistent label, common to all
    # test cases. Let's call it aggregated, to indicate that
    # the result represents multiple steps in lettuce scenario.
    testcase.setAttribute('name', 'aggregated')
    testcase.setAttribute('time', "0")
    return testcase