def parse_testsuite_xml(testsuite):
    """
    Flatten fields of interset from a TestSuite XML element into a dict
    """
    ts = dict()
    ts['name'] = testsuite.get('name')
    ts['tests'] = int(testsuite.get('tests', 0))
    ts['fails'] = int(testsuite.get('failures', 0))
    ts['skips'] = int(testsuite.get('skips', 0))
    ts['errors'] = int(testsuite.get('errors', 0))
    ts['passes'] = ts['tests'] - ts['fails'] - ts['skips']
    ts['time'] = int(float(testsuite.get('time', 0)))
    return ts