The page editor parses XML-tagged replace and insert blocks, validates them against the original text, and applies the changes in descending line order so line shifts do not disrupt subsequent edits.

sequenceDiagram
  autonumber
  participant LLM as Ideator (LLM)
  participant Parser as Page Editor Parser
  participant Applier as Patch Applier
  participant Page as Target Webpage

  LLM->>Parser: Emits XML edit tags (replace, insert)
  Parser->>Parser: Validates line bounds & extracts content
  Parser->>Applier: Passes validated edit list
  Applier->>Applier: Sorts edits in descending anchor order
  Applier->>Page: Applies bottom-up replacements & insertions
  Page-->>Applier: Returns updated document content