<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __initialize_tree(self, theme):
 """ Initializes the object formats tree. :param theme: Theme. :type theme: dict """


        for item in sorted(theme):
            current_node = self.__root_node
            for format in item.split("."):
                nodes = [node for node in current_node.children if node.name == format]
                format_node = foundations.common.get_first_item(nodes)
                if not format_node:
                    format_node = FormatNode(format, format=theme[item])
                    current_node.add_child(format_node)
                current_node = format_node