def parse_client_time(config_root):
    """
    Parse the client time (the duration that the test should be executed for)
    from the XML configuration.

    Parameters
    ----------
    config_root : xml.Element
        The root of the XML config file.

    Returns
    -------
    client_time : int
        The duration that the test should be executed for.

    Raises
    -------
    KeyError
        If the relevant key (works.work.time) is not present in the XML file.
    """
    try:
        return int(config_root.find('works').find('work').find('time').text)
    except:
        raise KeyError("Couldn't parse the config file for works.work.time.")