def _xds_version(xds_output_list):
    """Return the version of XDS which has been run."""
    for line in xds_output_list:
        if 'XDS VERSION' in line:
            return line.split('XDS VERSION')[1].split(')')[0].strip()
        if 'XDS' in line and 'VERSION' in line:
            return line.split('(VERSION')[1].split(')')[0].strip()
    raise RuntimeError('XDS version not found')
