The system uses an explicit [N] line numbering scheme to apply XML-tagged operations—such as replace and insert—in descending anchor line order, ensuring that modified line offsets remain stable during page optimization.