{"title":"XmlNode data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/xmlnode/xmlnode-data-type/","by":"JOP-AL","license":"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/xmlnode/xmlnode-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/xmlnode/xmlnode-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Represents a XML node which can either be for instance an XML attribute, an XML element or a XML document.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Instance methods","slug":"instance-methods","at":167,"chars":3822},{"level":2,"title":"Related information","slug":"related-information","at":3989,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nRepresents a XML node which can either be for instance an XML attribute, an XML element or a XML document.\n## Instance methods\nThe following methods are available on instances of the XmlNode data type.\nMethod name|Description\nAddAfterSelf(Any,...)<xmlnode-addafterself-method>|Adds the specified content immediately after this node.\nAddBeforeSelf(Any,...)<xmlnode-addbeforeself-method>|Adds the specified content immediately before this node.\nxmlnode-asxmlattribute-method|Converts the node to an XmlAttribute node. The operation will fail if the node is not an XmlAttribute.\nxmlnode-asxmlcdata-method|Converts the node to an XmlCData node. The operation will fail if the node is not an XmlCData.\nxmlnode-asxmlcomment-method|Converts the node to an XmlComment node. The operation will fail if the node is not an XmlComment.\nxmlnode-asxmldeclaration-method|Converts the node to an XmlDeclaration node. The operation will fail if the node is not an XmlDeclaration.\nxmlnode-asxmldocument-method|Converts the node to an XmlDocument node. The operation will fail if the node is not an XmlDocument.\nxmlnode-asxmldocumenttype-method|Converts the node to an XmlDocumentType node. The operation will fail if the node is not an XmlDocumentType.\nxmlnode-asxmlelement-method|Converts the node to an XmlElement node. The operation will fail if the node is not an XmlElement.\nxmlnode-asxmlprocessinginstruction-method|Converts the node to an XmlProcessingInstruction node. The operation will fail if the node is not an XmlProcessingInstruction.\nxmlnode-asxmltext-method|Converts the node to an XmlText node. The operation will fail if the node is not an XmlText.\nGetDocument(var XmlDocument)<xmlnode-getdocument-method>|Gets the XmlDocument for this node.\nGetParent(var XmlElement)<xmlnode-getparent-method>|Gets the parent XmlElement of this node.\nxmlnode-isxmlattribute-method|Gets a value indicating whether this node is an XmlAttribute.\nxmlnode-isxmlcdata-method|Gets a value indicating whether this node is an XmlCData.\nxmlnode-isxmlcomment-method|Gets a value indicating whether this node is an XmlComment.\nxmlnode-isxmldeclaration-method|Gets a value indicating whether this node is an XmlDeclaration.\nxmlnode-isxmldocument-method|Gets a value indicating whether this node is an XmlDocument.\nxmlnode-isxmldocumenttype-method|Gets a value indicating whether this node is an XmlDocumentType.\nxmlnode-isxmlelement-method|Gets a value indicating whether this node is an XmlElement.\nxmlnode-isxmlprocessinginstruction-method|Gets a value indicating whether this node is an XmlProcessingInstruction.\nxmlnode-isxmltext-method|Gets a value indicating whether this node is an XmlText.\nxmlnode-remove-method|Removes this node from its parent element.\nReplaceWith(Any,...)<xmlnode-replacewith-method>|Replaces this node with the specified content.\nSelectNodes(Text, var XmlNodeList)<xmlnode-selectnodes-string-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.\nSelectNodes(Text, XmlNamespaceManager, var XmlNodeList)<xmlnode-selectnodes-string-xmlnamespacemanager-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.\nSelectSingleNode(Text, var XmlNode)<xmlnode-selectsinglenode-string-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.\nSelectSingleNode(Text, XmlNamespaceManager, var XmlNode)<xmlnode-selectsinglenode-string-xmlnamespacemanager-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.\nxmlnode-writeto-outstream-method|Serializes and saves the current node to the given variable.\nxmlnode-writeto-xmlwriteoptions-outstream-method|Serializes and saves the current node to the given variable.\nWriteTo(var Text)<xmlnode-writeto-text-method>|Serializes and saves the current node to the given variable.\nWriteTo(XmlWriteOptions, var Text)<xmlnode-writeto-xmlwriteoptions-text-method>|Serializes and saves the current node to the given variable.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}