# XmlProcessingInstruction data type
> Version: _Available or changed with runtime version 1.0._
Represents a processing instruction, which XML defines to keep processor-specific information in the text of the document.
## Static methods
The following methods are available on the XmlProcessingInstruction data type.
Method name|Description
Create(Text, Text)<xmlprocessinginstruction-create-method>|Creates an XmlProcessingInstruction node.
## Instance methods
The following methods are available on instances of the XmlProcessingInstruction data type.
Method name|Description
AddAfterSelf(Any,...)<xmlprocessinginstruction-addafterself-method>|Adds the specified content immediately after this node.
AddBeforeSelf(Any,...)<xmlprocessinginstruction-addbeforeself-method>|Adds the specified content immediately before this node.
xmlprocessinginstruction-asxmlnode-method|Converts the node to an XmlNode.
GetData(var Text)<xmlprocessinginstruction-getdata-method>|Gets the content of the processing instruction, excluding the target.
GetDocument(var XmlDocument)<xmlprocessinginstruction-getdocument-method>|Gets the XmlDocument for this node.
GetParent(var XmlElement)<xmlprocessinginstruction-getparent-method>|Gets the parent XmlElement of this node.
GetTarget(var Text)<xmlprocessinginstruction-gettarget-method>|Gets the target of the processing instruction.
xmlprocessinginstruction-remove-method|Removes this node from its parent element.
ReplaceWith(Any,...)<xmlprocessinginstruction-replacewith-method>|Replaces this node with the specified content.
SelectNodes(Text, var XmlNodeList)<xmlprocessinginstruction-selectnodes-string-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.
SelectNodes(Text, XmlNamespaceManager, var XmlNodeList)<xmlprocessinginstruction-selectnodes-string-xmlnamespacemanager-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.
SelectSingleNode(Text, var XmlNode)<xmlprocessinginstruction-selectsinglenode-string-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.
SelectSingleNode(Text, XmlNamespaceManager, var XmlNode)<xmlprocessinginstruction-selectsinglenode-string-xmlnamespacemanager-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.
SetData(Text)<xmlprocessinginstruction-setdata-method>|Sets the content of the processing instruction, excluding the target.
SetTarget(Text)<xmlprocessinginstruction-settarget-method>|Sets the target of the processing instruction.
xmlprocessinginstruction-writeto-outstream-method|Serializes and saves the current node to the given variable.
xmlprocessinginstruction-writeto-xmlwriteoptions-outstream-method|Serializes and saves the current node to the given variable.
WriteTo(var Text)<xmlprocessinginstruction-writeto-text-method>|Serializes and saves the current node to the given variable.
WriteTo(XmlWriteOptions, var Text)<xmlprocessinginstruction-writeto-xmlwriteoptions-text-method>|Serializes and saves the current node to the given variable.
## Related information
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/xmlprocessinginstruction/xmlprocessinginstruction-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/xmlprocessinginstruction/xmlprocessinginstruction-data-type/
