def update(self, yaml_dict):
        ''' Update the content (i.e. keys and values) with yaml_dict.
        '''
        def _update_node(base_node, update_node):
            if isinstance(update_node, YAMLDict) or \
                    isinstance(update_node, dict):
                if not (isinstance(base_node, YAMLDict)):
                    # NOTE: A regular dictionary is replaced by a new
                    #       YAMLDict object.
                    new_node = YAMLDict()
                else:
                    new_node = base_node
                for k, v in update_node.items():
                    new_node[k] = _update_node(new_node.get(k), v)
            elif isinstance(update_node, list) or isinstance(
                update_node, tuple
            ):
                # NOTE: A list/tuple is replaced by a new list/tuple.
                new_node = []
                for v in update_node:
                    new_node.append(_update_node(None, v))
                if isinstance(update_node, tuple):
                    new_node = tuple(new_node)
            else:
                new_node = update_node
            return new_node
        # Convert non-YAMLDict objects to a YAMLDict
        if not (isinstance(yaml_dict, YAMLDict) or
                isinstance(yaml_dict, dict)):
            yaml_dict = YAMLDict(yaml_dict)
        _update_node(self, yaml_dict)