{"title":"XmlElement data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/xmlelement/xmlelement-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/xmlelement/xmlelement-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/xmlelement/xmlelement-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 an XML element.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Static methods","slug":"static-methods","at":87,"chars":459},{"level":2,"title":"Instance methods","slug":"instance-methods","at":546,"chars":5274},{"level":2,"title":"Related information","slug":"related-information","at":5820,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nRepresents an XML element.\n## Static methods\nThe following methods are available on the XmlElement data type.\nMethod name|Description\nCreate(Text)<xmlelement-create-string-method>|Creates an XmlElement node.\nCreate(Text, Text)<xmlelement-create-string-string-method>|Creates an XmlElement node.\nCreate(Text, Text, Any,...)<xmlelement-create-string-string-joker-method>|Creates an XmlElement node.\nCreate(Text, Any,...)<xmlelement-create-string-joker-method>|Creates an XmlElement node.\n## Instance methods\nThe following methods are available on instances of the XmlElement data type.\nMethod name|Description\nAdd(Any,...)<xmlelement-add-method>|Adds the specified content as a child of this element.\nAddAfterSelf(Any,...)<xmlelement-addafterself-method>|Adds the specified content immediately after this node.\nAddBeforeSelf(Any,...)<xmlelement-addbeforeself-method>|Adds the specified content immediately before this node.\nAddFirst(Any,...)<xmlelement-addfirst-method>|Adds the specified content at the start of the child list of this element.\nxmlelement-asxmlnode-method|Converts the node to an XmlNode.\nxmlelement-attributes-method|Gets a collection of the attributes of this element.\nxmlelement-getchildelements--method|Gets a list containing the child elements for this element, in document order.\nGetChildElements(Text)<xmlelement-getchildelements-string-method>|Gets a list containing the child elements for this element, in document order.\nGetChildElements(Text, Text)<xmlelement-getchildelements-string-string-method>|Gets a list containing the child elements for this element, in document order.\nxmlelement-getchildnodes-method|Gets a list containing the child elements for this element, in document order.\nxmlelement-getdescendantelements--method|Gets a list containing the descendant elements for this element, in document order.\nGetDescendantElements(Text)<xmlelement-getdescendantelements-string-method>|Gets a list containing the descendant elements for this element, in document order.\nGetDescendantElements(Text, Text)<xmlelement-getdescendantelements-string-string-method>|Gets a list containing the descendant elements for this element, in document order.\nxmlelement-getdescendantnodes-method|Gets a list containing the descendant nodes for this element, in document order.\nGetDocument(var XmlDocument)<xmlelement-getdocument-method>|Gets the XmlDocument for this node.\nGetNamespaceOfPrefix(Text, var Text)<xmlelement-getnamespaceofprefix-method>|Gets the namespace associated with a particular prefix for this element.\nGetParent(var XmlElement)<xmlelement-getparent-method>|Gets the parent XmlElement of this node.\nGetPrefixOfNamespace(Text, var Text)<xmlelement-getprefixofnamespace-method>|Gets the prefix associated with a namespace URI for this element.\nxmlelement-hasattributes-method|Gets a boolean value indicating whether this element has at least one attribute.\nxmlelement-haselements-method|Gets a value indicating whether this element has at least one child element.\nxmlelement-innertext-method|Gets the concatenated values of the node and all its child nodes.\nxmlelement-innerxml-method|Gets the markup representing only the child nodes of this node.\nxmlelement-isempty-method|Gets a value indicating whether this element contains no content.\nxmlelement-localname-method|Gets the local name of this element.\nxmlelement-name-method|Gets the fully qualified name of this element.\nxmlelement-namespaceuri-method|Gets the namespace URI of this element.\nxmlelement-remove-method|Removes this node from its parent element.\nxmlelement-removeallattributes-method|Removes the attributes of this element.\nRemoveAttribute(Text)<xmlelement-removeattribute-string-method>|Removes the specified attribute from this element.\nRemoveAttribute(Text, Text)<xmlelement-removeattribute-string-string-method>|Removes the specified attribute from this element.\nxmlelement-removeattribute-xmlattribute-method|Removes the specified attribute from this element.\nxmlelement-removenodes-method|Removes the child nodes from this element.\nReplaceNodes(Any,...)<xmlelement-replacenodes-method>|Replaces the children nodes of this element with the specified content.\nReplaceWith(Any,...)<xmlelement-replacewith-method>|Replaces this node with the specified content.\nSelectNodes(Text, var XmlNodeList)<xmlelement-selectnodes-string-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.\nSelectNodes(Text, XmlNamespaceManager, var XmlNodeList)<xmlelement-selectnodes-string-xmlnamespacemanager-xmlnodelist-method>|Selects a list of nodes matching the XPath expression.\nSelectSingleNode(Text, var XmlNode)<xmlelement-selectsinglenode-string-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.\nSelectSingleNode(Text, XmlNamespaceManager, var XmlNode)<xmlelement-selectsinglenode-string-xmlnamespacemanager-xmlnode-method>|Selects the first XmlNode that matches the XPath expression.\nSetAttribute(Text, Text)<xmlelement-setattribute-string-string-method>|Sets the value of the specified attribute or create it if is not part of the element's attribute collection.\nSetAttribute(Text, Text, Text)<xmlelement-setattribute-string-string-string-method>|Sets the value of the specified attribute or create it if is not part of the element's attribute collection.\nxmlelement-writeto-outstream-method|Serializes and saves the current node to the given variable.\nxmlelement-writeto-xmlwriteoptions-outstream-method|Serializes and saves the current node to the given variable.\nWriteTo(var Text)<xmlelement-writeto-text-method>|Serializes and saves the current node to the given variable.\nWriteTo(XmlWriteOptions, var Text)<xmlelement-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>"}