'"A tool shed repository is being installed so change the shed_tool_conf file.  Parse the
config file to generate the entire list of config_elems instead of using the in-memory list
since it will be a subset of the entire list if one or more repositories have been deactivated.'

def add_to_shed_tool_config(self, shed_tool_conf_dict, elem_list):

    if (not elem_list):
        return
    old_toolbox = self.app.toolbox
    shed_tool_conf = shed_tool_conf_dict['config_filename']
    tool_path = shed_tool_conf_dict['tool_path']
    config_elems = []
    (tree, error_message) = xml_util.parse_xml(shed_tool_conf)
    if tree:
        root = tree.getroot()
        for elem in root:
            config_elems.append(elem)
        for elem_entry in elem_list:
            config_elems.append(elem_entry)
        self.config_elems_to_xml_file(config_elems, shed_tool_conf, tool_path)
        self.app.wait_for_toolbox_reload(old_toolbox)
