<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_template_srcmodule(self, stack, path):
 """ This function actually fills the stack with definitions coming from a template file """

        srcmodule = _run_resources_file(path, stack)
        # Process the loaded module and find the stack elements
        elements = self.find_stack_elements(srcmodule)
        elements = sorted(elements, key=lambda x: x[:-1])
        # Assign a name to each element and add to our dictionaries
        for (module_name, el_name, element) in elements:
            full_name = self.generate_cfn_name(module_name, el_name)
            self.name_stack_element(element, full_name)
            self.add_stack_element(element)