'The value of env_var_name must match the value of the "set_environment" type
in the tool config\'s <requirements> tag set, or the tool dependency will be
considered an orphan.'

def generate_environment_dependency_metadata(self, elem, valid_tool_dependencies_dict):

    for env_elem in elem:
        env_name = env_elem.get('name', None)
        if env_name:
            requirements_dict = dict(name=env_name, type='set_environment')
            if ('set_environment' in valid_tool_dependencies_dict):
                valid_tool_dependencies_dict['set_environment'].append(requirements_dict)
            else:
                valid_tool_dependencies_dict['set_environment'] = [requirements_dict]
    return valid_tool_dependencies_dict
