X++:
COM dom;
XMLProcessingInstruction instruction;
xmlDocument xmlDocument;
;
dom = XMLDocument::XMLDOM();
xmlDocument = xmlNode::construct(dom);
instruction = xmlDocument.createProcessingInstruction('xml', 'version="1.0" encoding="UTF-8"');
xmlDocument.appendChild(instruction);