Skip to main content

Parse XML

Parses an XML string into a nested object, making its elements and attributes accessible via expressions.

Properties

PropertyRequiredDescription
XML InputYesThe XML string to parse. Supports expressions

Output

FieldTypeDescription
dataObjectThe parsed XML document as a nested object

Access the output in downstream nodes:

{{ $nodes['Parse XML'].data }}
{{ $nodes['Parse XML'].data.root.item.name }}

Replace Parse XML with the actual name you gave the node.

Parsing rules

XML constructRepresentation
ElementObject key matching the element name
Element with text contentString value
AttributeKey prefixed with @ (e.g. @id)
Repeated sibling elementsArray
Nested elementsNested object

Example — input XML

<users>
<user id="1">
<name>Alice</name>
<email>alice@example.com</email>
</user>
<user id="2">
<name>Bob</name>
<email>bob@example.com</email>
</user>
</users>

Resulting object

{
"users": {
"user": [
{ "@id": "1", "name": "Alice", "email": "alice@example.com" },
{ "@id": "2", "name": "Bob", "email": "bob@example.com" }
]
}
}

Access the first user's name:

{{ $nodes['Parse XML'].data.users.user[0].name }}

Behaviour

  • An empty or whitespace-only input produces data: null without failing.
  • If the string is not valid XML the node fails.
  • Repeated sibling elements of the same name are automatically collected into an array. A single element of that name remains an object (not an array).

Notes

  • For API responses that return XML, pipe the responseBody from an HTTP Request node directly into XML Input.
  • Use a Loop node on the parsed array to process repeated elements one at a time.