The page editor feeds the LLM an input page numbered with 1-indexed tags, parses three XML edit primitives from the response, and ensures reliable reconstruction by having those edits sorted and applied in descending line-number order.

sequenceDiagram
    autonumber
    participant PE as Page Editor
    participant LLM as Ideator (LLM)
    participant DOC as Original Document

    Note over PE,DOC: Index lines [1..N]
    PE->>LLM: Send line-numbered markdown
    LLM-->>PE: Return XML patch tags
    Note over PE: Parse and sort edits DESC
    PE->>DOC: Apply edits bottom-to-top
    DOC-->>PE: Return modified page