Parse XML
Parses an XML string into a nested object, making its elements and attributes accessible via expressions.
Properties
| Property | Required | Description |
|---|---|---|
| XML Input | Yes | The XML string to parse. Supports expressions |
Output
| Field | Type | Description |
|---|---|---|
data | Object | The 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 construct | Representation |
|---|---|
| Element | Object key matching the element name |
| Element with text content | String value |
| Attribute | Key prefixed with @ (e.g. @id) |
| Repeated sibling elements | Array |
| Nested elements | Nested 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: nullwithout 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
responseBodyfrom an HTTP Request node directly into XML Input. - Use a Loop node on the parsed array to process repeated elements one at a time.