Native XFA XML Comments and Processing Instructions
Native exData loadXML and saveXML preserve in-element XML comments and processing instructions with their order, literal payloads and instruction targets
Native representation
The raw node keeps Name=#text; XMLContentKind distinguishes ordinary character data, comments and instructions, so element, packet and property scans can retain their separate content rules
Comments and instructions stay outside SOM results; publishable Data character records can appear as unnamed logical dataValue children without exposing the physical #text marker
Ordinary text and CDATA continue to contribute to the parent's aggregate Value; comments and instructions do not become scalar field values or visible rich-text runs
Comment := Node.AddComment('retained metadata');
Instruction := Node.AddProcessingInstruction('audit', 'reviewed');
SetText replaces ordinary text and CDATA while retaining comment and instruction children; removing nontext children leaves text aggregation unchanged
Persistence and transactions
The native XDP parser, writer and packet fingerprints retain in-element comments and instructions through save and reload; payload or target changes mark their packet modified
Immediate script serialisation observes imported nontext content, and both engine failure and native publication budgets restore the original content byte exactly
Comment and instruction nodes consume XML import and serialisation node budgets; their payloads consume byte budgets and native packet text limits
Actual PDF consumption
The saved producer reopens its XDP before THotPDF.ApplyXFAAsAcroForm; independent XML, pypdf and MuPDF checks confirm actual native payloads remain saved while their marker text is absent from page text
Existing rich text, font, size and colour remain visible, and cloned and cleared occurrences retain their documented behaviour
Remaining XML targets
This support covers markup inside document elements; document-level comments and instructions outside the root element, complete lexical whitespace preservation, other node-class XML methods, Data DOM structural import and DTD entity catalogues remain separate implementation targets
External references and complete foreign media consumers remain separate implementation targets