'Populate or unpopulate the toolshed and changeset_revision attributes for each of
the following tag sets.
<action type="set_environment_for_install">
<action type="setup_r_environment">
<action type="setup_ruby_environment">'

def handle_sub_elem(self, parent_elem, elem_index, elem):

    sub_elem_altered = False
    error_message = ''
    for (sub_index, sub_elem) in enumerate(elem):
        if (sub_elem.tag == 'repository'):
            (altered, new_sub_elem, message) = self.handle_elem(sub_elem)
            if message:
                error_message += ('The    %s    file    contains    an    invalid    <repository>    tag.        %s' % (TOOL_DEPENDENCY_DEFINITION_FILENAME, message))
            if altered:
                if (not sub_elem_altered):
                    sub_elem_altered = True
                elem[sub_index] = new_sub_elem
    if sub_elem_altered:
        parent_elem[elem_index] = elem
    return (sub_elem_altered, parent_elem, error_message)
