---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Orchestration Builder, Orchestrate, Orchestration]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: Xml Member Functions
layout: subsection
---

<a id="section_N10022_N1001F_N10001"></a>
<b>Instance Type: XmlType</b>

<table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>assertValue</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns the XML document itself if it is valid. Otherwise, throws an exception.</td></tr><tr><td>beautifyXML</td><td>Arguments: <ul><li>indentSpaces (Number)
</li></ul> <p>Return Type:</p><ul><li>BigDecimal
</li></ul> Returns a new XML document with the XML content formatted for human readability using the specified number of indentSpaces.</td></tr><tr><td>bigDecimalAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>BigDecimal
</li></ul> Returns the value at the specified XPath as a BigDecimal if the XPath points to a text node and the value is numeric. Otherwise, throws an exception.</td></tr><tr><td>bigDecimalAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (BigDecimal)
</li></ul> <p>Return Type:</p><ul><li>BigDecimal
</li></ul> Returns the value at the specified XPath as a BigDecimal if the XPath points to a text node and the value is numeric. Returns the supplied default if no value exists at the specified XPath. Throws an exception if the value at the XPath isn't numeric.</td></tr><tr><td>bigDecimalsAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>BigDecimal
</li></ul> Returns all text node values that match the specified XPath provided all the values matched are numeric. Otherwise, throws an exception.</td></tr><tr><td>booleanAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns the boolean leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't a boolean.</td></tr><tr><td>booleanAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (Boolean)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns the boolean leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't a boolean.</td></tr><tr><td>booleansAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns all boolean leaf node values that match the specified XPath. Throws an exception if not all the values matched are boolean.</td></tr><tr><td>canonicalize</td><td>Arguments: <ul><li>withComments
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns a new XML in the inclusive canonical form, according to the Canonical XML Version 1.0 specification. Includes comments from the original if withComments is set to true.</td></tr><tr><td>convertToJson</td><td>Converts an XML document to a JSON document using a default conversion process. Attributes are included.</td></tr><tr><td>convertToJson</td><td>Arguments: <ul><li>ignoreAttributes (Boolean)
</li><li>tryConvertTypes (Boolean)
</li></ul> <p>Return Type:</p><ul><li>Json
</li></ul> Converts an XML document to a JSON document using a default conversion process. If tryConvertTypes is set to false every JSON field will be a string.</td></tr><tr><td>convertToJsonNullEmptyTags</td><td>Arguments: <ul><li>ignoreAttributes (Boolean)
</li><li>tryConvertTypes (Boolean)
</li></ul> <p>Return Type:</p><ul><li>Json
</li></ul> Returns a JSON document with empty tags from the XML original given a null value. If tryConvertTypes is set to false every JSON field will be a string.</td></tr><tr><td>convertToJsonRemoveEmptyTags</td><td>Arguments: <ul><li>ignoreAttributes (Boolean)
</li><li>tryConvertTypes (Boolean)
</li></ul> <p>Return Type:</p><ul><li>Json
</li></ul> Returns a JSON document with empty tags from the XML original removed. If tryConvertTypes is set to false every JSON field will be a string.</td></tr><tr><td>countItemsAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Number
</li></ul> Returns a count of the number of items that match the specified XPath.</td></tr><tr><td>dateAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Date
</li></ul> Returns the Local Date leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't a valid ISO Local Date.</td></tr><tr><td>dateAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (Date)
</li></ul> <p>Return Type:</p><ul><li>Date
</li></ul> Returns the Local Date leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't a valid ISO Local Date.</td></tr><tr><td>dateTimeAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>LocalDateTime
</li></ul> Returns the Local Date Time leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't a valid ISO Local Date Time.</td></tr><tr><td>dateTimeAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (LocalDateTime)
</li></ul> <p>Return Type:</p><ul><li>LocalDateTime
</li></ul> Returns the Local Date Time leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't a valid ISO Local Date Time.</td></tr><tr><td>distinct</td><td>Arguments: <ul><li>xpath (String)
</li><li>keyXPath (String)
</li><li>header (String)
</li><li>footer (String)
</li><li>separator (String)
</li><li>includeXmlDeclaration (Boolean)
</li><li></li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns an XML document containing a collection of aggregated XML fragments selected by the specified XPath. Uniqueness is tested by selecting a value within each XML fragment of the collection using the specified key XPath.</td></tr><tr><td>excludeAllNamespaces</td><td>Arguments: <ul><li>None
</li><li></li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns an XML document with all namespaces excluded but with the structure otherwise intact.</td></tr><tr><td>exists</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns true if the specified XPath returns a nonempty sequence.</td></tr><tr><td>filterWhereElementAbsent</td><td>Arguments: <ul><li>xpath (String)
</li><li>elementXPath (String)
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns an XML document containing XML fragments selected by the specified xpath, aggregating only fragments where the specified elementXPath is absent. Acts as a workaround for XPath predicates like not(element) or count(element)=0.</td></tr><tr><td>filterWhereElementAbsent</td><td>Arguments: <ul><li>xpath (String)
</li><li>elementXPath (String)
</li><li>separator (String)
</li><li>includeXmlDeclaration (Boolean)
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns an XML document containing XML fragments selected by the specified xpath, aggregating only fragments where the specified elementXPath is absent, using the specified separator. Includes the XML declaration when the boolean value is set to true. Acts as a workaround for XPath predicates like not(element) or count(element)=0.</td></tr><tr><td>fragmentAtXpath</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>Xml
</li></ul> Returns the first fragment of XML matching the given XPath. Throws an exception if the XPath doesn't match anything.</td></tr><tr><td>includeCharactersUsingList</td><td>Arguments: <ul><li>inclusionList (StringListType)
</li><li>defaultReplacement (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns an XML file, replacing any characters not present in the inclusion list with the specified replacement. Characters that are on the inclusion list are returned unchanged. XML control characters are returned unchanged.</td></tr><tr><td>isDateAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if the value at the specified XPath is a valid ISO Local Date.</td></tr><tr><td>isDateTimeAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if the value at the specified XPath is a valid ISO Local Date Time.</td></tr><tr><td>isValid</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if the XML document is valid.</td></tr><tr><td>isValueAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if a value exists at the specified XPath - that is, returns true if stringAtXPath() for the specified XPath would return a value.</td></tr><tr><td>isWorkdayInvalidReference</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if the fragment is a Workday SOAP API invalid reference response.</td></tr><tr><td>isZonedDateTimeAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns true if the value at the specified XPath is a valid ISO Offset Date Time or ISO Instant.</td></tr><tr><td>iterator</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>XmlDataIterator
</li></ul> Returns an iterator of XML values matching the specified XPath as XmlType instances.</td></tr><tr><td>iterator</td><td>Arguments: <ul><li>xpath (String)
</li><li>batchSize (Number)
</li><li>header (String)
</li><li>footer (String)
</li></ul> <p>Return Type:</p><ul><li>Boolean
</li></ul> Returns an iterator of XML values matching the specified XPath as XmlType instances, batched into an XML document with the specified number of records. Also returns a root element defined by the specified header and footer.</td></tr><tr><td>localNameAtXpath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the local part of the element name in the supplied XPath. If the selected XPath doesn't point to a leaf node, returns the local name of the first matching node. If there are no matches, returns an empty string is returned</td></tr><tr><td>numberAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>Number
</li></ul> Returns the numeric leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't numeric.</td></tr><tr><td>numberAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (Number)
</li></ul> <p>Return Type:</p><ul><li>Number
</li></ul> Returns the numeric leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't numeric.</td></tr><tr><td>numbersAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>NumberList
</li></ul> Returns all numeric leaf node values that match the specified XPath. Throws an exception if not all the values matched are numeric.</td></tr><tr><td>removeAttributes</td><td>Arguments: <ul><li>xpath (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all attributes matching the supplied XPath removed.</td></tr><tr><td>removeDtdDeclaration</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>XML
</li></ul> Returns a new XML document with DTD declaration removed.</td></tr><tr><td>removeFragments</td><td>Arguments: <ul><li>xpath (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all fragments matching the specified XPath removed.</td></tr><tr><td>removeWhitespace</td><td>Arguments: <ul><li>None
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all white space removed.</td></tr><tr><td>removeXmlDeclaration</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>XML
</li></ul> Returns a new XML document with XML declaration removed.</td></tr><tr><td>replaceAllNamespaces</td><td>Arguments: <ul><li>newNamespace (String)
</li><li>newPrefix (String)
</li></ul> Return Type: <ul><li>XML
</li></ul> Returns a new XML document with all namespaces replaced by the specified namespace and prefix.</td></tr><tr><td>replaceAndIncludeCharacters</td><td>Arguments: <ul><li>mapping (StringMapType)
</li><li>defaultReplacement (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns an XML file with characters replaced according to the provided mapping. If a character is missing from the provided document, the default string is returned in its place. XML control characters are returned unchanged.</td></tr><tr><td>replaceAttributes</td><td>Arguments: <ul><li>xpath (StringType)
</li><li>replacementLocalPart (StringType)
</li><li>replacementValue (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all attributes matching the specified XPath replaced by the specified attribute and attribute value. The default namespace applies.</td></tr><tr><td>replaceAttributes</td><td>Arguments: <ul><li>xpath (StringType)
</li><li>replacementLocalPart (StringType)
</li><li>replacementNamespacePrefix (StringType)
</li><li>replacementValue (StringType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all attributes matching the specified XPath replaced by the specified attribute and attribute value. The namespace associated with the specified prefix applies.</td></tr><tr><td>replaceCharactersUsingMapping</td><td>Arguments: <ul><li>mapping (StringMapType)
</li></ul> Return types: <ul><li>Xml
</li></ul> Returns an XML file with characters replaced according to the provided mapping. If a character isn't mapped, it's returned unchanged.</td></tr><tr><td>replaceFragments</td><td>Arguments: <ul><li>xpath (StringType)
</li><li>replacement (XmlType)
</li></ul> Return type: <ul><li>Xml
</li></ul> Returns a new XML document with all fragments matching the specified XPath replaced by the specified XML fragment.</td></tr><tr><td>replaceNamespace</td><td>Arguments: <ul><li>oldNamespace (String)
</li><li>newNamespace (String)
</li></ul> Return Type: <ul><li>XML
</li></ul> Returns a new XML document with all instances of the specified oldNamespace replaced by the specified newNamespace.</td></tr><tr><td>replaceNamespacePrefix</td><td>Arguments: <ul><li>oldPrefix (String)
</li><li>newPrefix (String)
</li></ul> Return Type: <ul><li>XML
</li></ul> Returns a new XML document with all instances of the specified oldPrefix replaced by the specified newPrefix.</td></tr><tr><td>soapFaultCode</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the SOAP 1.1/1.2 fault code if one is present. Otherwise throws an exception.</td></tr><tr><td>stringAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the string leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't a string.</td></tr><tr><td>stringAtXPathOrEmptyString</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the value at the specified XPath if the XPath points to a text node or an attribute. Otherwise returns an empty string. Provides a safe way to extract values without throwing exceptions when the path doesn't exist.</td></tr><tr><td>stringAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the string leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't a string.</td></tr><tr><td>stringsAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>StringList
</li></ul> Returns all leaf node values that match the given XPath. Throws an exception if not all the values at the path are strings.</td></tr><tr><td>unwrapSoap</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>StringList
</li></ul> Unwraps an XML document from a SOAP envelope if one is present. Supports SOAP 1.1 and SOAP 1.2.</td></tr><tr><td>wrapSoapV11</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>StringList
</li></ul> Wraps the provided XML document in a SOAP 1.1 envelope.</td></tr><tr><td>wrapSoapV12</td><td>Arguments: <ul><li>None
</li></ul> <p>Return Type:</p><ul><li>StringList
</li></ul> Wraps the provided XML document in a SOAP 1.2 envelope.</td></tr><tr><td>xmlString</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the value at the given XPath if the XPath points to a text node or an attribute, else throws an exception. The string is escaped for inclusion in XML.</td></tr><tr><td>xmlStringWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (String)
</li></ul> <p>Return Type:</p><ul><li>String
</li></ul> Returns the value at the specified XPath if the XPath points to a text node or an attribute. Otherwise, returns the specified default. The extracted string is escaped for inclusion in XML. The default value is used as supplied.</td></tr><tr><td>xmlStrings</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>StringList
</li></ul> Returns all text node or attribute values that match the specified XPath. The strings are escaped for inclusion in XML.</td></tr><tr><td>zonedDateTimeAtXPath</td><td>Arguments: <ul><li>xpath (String)
</li></ul> <p>Return Type:</p><ul><li>ZonedDateTime
</li></ul> Returns the ISO Offset Date Time or ISO Instant leaf node value at the specified XPath. Throws an exception if the XPath doesn't point to a leaf node value or the value isn't a valid ISO Offset Date Time or ISO Instant.</td></tr><tr><td>zonedDateTimeAtXPathWithDefault</td><td>Arguments: <ul><li>xpath (String)
</li><li>defaultValue (ZonedDateTime)
</li></ul> <p>Return Type:</p><ul><li>ZonedDateTime
</li></ul> Returns the ISO Offset Date Time or ISO Instant leaf node value at the specified XPath or the specified default if no leaf node value exists. Throws an exception if a value exists at the path but isn't a valid ISO Offset Date Time or ISO Instant.</td></tr></tbody></table><br/>

<table><thead></thead><tbody><tr><td>Type</td><td>Returns the value at the given XPath if the XPath points to a text node or an attribute, else returns an empty string. This provides a safe way to extract values without throwing exceptions when the path doesn't exist, making it useful for optional data extraction from XML documents.</td></tr></tbody></table><br/>

