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 node keeps Name=#text so existing element, SOM, packet and property binding scans carry on skipping non-element content; XMLContentKind distinguishes text, comment and instruction nodes

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 whilst 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 as modified

Immediate script serialisation observes imported nontext content, and both engine failure and native publication budgets restore the original content byte for byte

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 stay saved whilst 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 stay separate implementation targets

Native exData XML and XFA Packet DOM

TXFANode and Native XML Content