compare_nodes

        High-level api: Compare node1 and node2 and put the result in ret.

        Parameters
        ----------

        node1 : `Element`
            A node in a model tree.

        node2 : `Element`
            A node in another model tree.

        ret : `Element`
            A node in self.tree.

        Returns
        -------

        None
            Nothing returns.

def compare_nodes(node1, node2, ret):
        '''compare_nodes

        High-level api: Compare node1 and node2 and put the result in ret.

        Parameters
        ----------

        node1 : `Element`
            A node in a model tree.

        node2 : `Element`
            A node in another model tree.

        ret : `Element`
            A node in self.tree.

        Returns
        -------

        None
            Nothing returns.
        '''

        for child in node2.getchildren():
            peer = ModelDiff.get_peer(child.tag, node1)
            if peer is None:
                ModelDiff.copy_subtree(ret, child, 'added')
            else:
                if ModelDiff.node_equal(peer, child):
                    continue
                else:
                    if child.attrib['type'] in ['leaf-list', 'leaf']:
                        ModelDiff.copy_node(ret, child, 'modified')
                    else:
                        ret_child = ModelDiff.copy_node(ret, child, '')
                        ModelDiff.compare_nodes(peer, child, ret_child)
        for child in node1.getchildren():
            peer = ModelDiff.get_peer(child.tag, node2)
            if peer is None:
                ModelDiff.copy_subtree(ret, child, 'deleted')