'Recursively imports all child blocks from the temporary modulestore into the
target modulestore.'

def recursive_build(self, source_courselike, courselike, courselike_key, dest_id):

    all_locs = set(self.xml_module_store.modules[courselike_key].keys())
    all_locs.remove(source_courselike.location)
    def depth_first(subtree):
        '\n                                                Import    top    down    just    so    import    code    can    make    assumptions    about    parents    always    being    available\n                                                '
        if subtree.has_children:
            for child in subtree.get_children():
                try:
                    all_locs.remove(child.location)
                except KeyError:
                    pass
                if self.verbose:
                    log.debug('importing    module    location    %s', child.location)
                _update_and_import_module(child, self.store, self.user_id, courselike_key, dest_id, do_import_static=self.do_import_static, runtime=courselike.runtime)
                depth_first(child)
    depth_first(source_courselike)
    for leftover in all_locs:
        if self.verbose:
            log.debug('importing    module    location    %s', leftover)
        _update_and_import_module(self.xml_module_store.get_item(leftover), self.store, self.user_id, courselike_key, dest_id, do_import_static=self.do_import_static, runtime=courselike.runtime)
