def METHOD_NAME(self):
    node: Union[Document, Section] = self.node
    traceability_index = self.traceability_index
    # Updating section content.
    if self.validated_free_text_container is not None:
        free_text_container: FreeTextContainer = (
            self.validated_free_text_container
        )
        existing_links_to_remove: List[InlineLink] = []
        existing_anchor_uids_to_remove = set()
        if len(node.free_texts) > 0:
            for part in node.free_texts[0].parts:
                if isinstance(part, Anchor):
                    existing_anchor_uids_to_remove.add(part.value)
                elif isinstance(part, InlineLink):
                    existing_links_to_remove.append(part)
        if len(node.free_texts) > 0:
            free_text: FreeText = node.free_texts[0]
        else:
            free_text = FreeText(node, [])
            node.free_texts.append(free_text)
        free_text.parts = free_text_container.parts
        free_text.parent = node
        new_links_to_add: List[InlineLink] = []
        for part in free_text.parts:
            if isinstance(part, Anchor):
                if part.value in existing_anchor_uids_to_remove:
                    existing_anchor_uids_to_remove.remove(part.value)
                # By this time, we know that the validations have passed
                # just before, so it is safe to update the anchor.
                traceability_index.update_with_anchor(part)
                part.parent = free_text
            elif isinstance(part, InlineLink):
                part.parent = free_text
                new_links_to_add.append(part)
        for anchor_uid_to_be_removed in existing_anchor_uids_to_remove:
            anchor = traceability_index.graph_database.get_node_by_uid(
                anchor_uid_to_be_removed
            )
            traceability_index.graph_database.remove_node_by_mid(anchor.mid)
        for existing_link in existing_links_to_remove:
            traceability_index.remove_inline_link(existing_link)
        for new_link in new_links_to_add:
            traceability_index.create_inline_link(new_link)
    else:
        existing_links_to_remove = []
        if len(node.free_texts) > 0:
            for part in node.free_texts[0].parts:
                if isinstance(part, InlineLink):
                    existing_links_to_remove.append(part)
        for existing_link in existing_links_to_remove:
            traceability_index.remove_inline_link(existing_link)
        node.free_texts = []