Steps
Give the XML node a text field, not a file
The XML node only reads a JSON string field, set in Property Name (default
data). A binary .xml file sent straight into it failed withItem has no JSON property called "data". For files, add Extract From File with the operation Extract From XML first, then the XML node: that parsed fine, and an ISO-8859-1 file came out with correct accents. The same error appears when your text is in another field, for example an HTTP response inbody: set Property Name tobody.Turn on Explicit Array before Split Out
With the default options, two
<item>elements become an array, but one<item>becomes a plain object. Split Out onrss.channel.itemthen split the single object's fields into 3 junk items, while the 2-item feed split correctly. So a workflow that works on most days breaks the day the feed or API returns one result. Turn on Options, Explicit Array (every value becomes an array, so referencetitle[0]), or normalize it in an expression:{{ [].concat($json.rss.channel.item) }}.Know where attributes and text go
By default attributes are merged as plain keys (
id,version,currency). An element that has attributes and text, like<price currency="EUR">19.90</price>, becomes{"_":"19.90","currency":"EUR"}, so$json.priceis an object and the text is$json.price._. Merge Attributes off puts attributes under$. Ignore Attributes drops them and givespriceas plain"19.90". Explicit Root off removes the outer key (rss), and Normalize Tags lowercases names.Convert numbers yourself
Every value comes out as a string:
"19.90", and"0042"keeps its leading zeros. Comparisons in IF, Filter or Switch with number operators then hit type errors or compare text. Use{{ Number($json.price._) }}or the Edit Fields node with type Number.Read the parse error: it is usually not XML
If the input isn't XML, the run fails. HTML with
<br>gaveUnexpected close tag. A JSON string gaveNon-whitespace before first tag.with Char{: the API returned JSON, so you don't need the XML node. An object field gave the same error with Char[, because n8n turned it into[object Object]. A bare&(Tom & Jerry) gaveInvalid character in entity name, and truncated XML gaveUnclosed root tag. An empty string gave the confusingCannot read properties of null (reading '$error'): check that the previous node returned a body.Don't hide parse errors with Continue
With On Error set to Continue (regular output), a parse error returned zero items with a green run and no error field, so the next nodes simply didn't run. Use Continue (using error output) if you want to handle bad XML, or leave it on Stop.
Trim whitespace, handle namespaces
By default spaces and newlines inside tags are kept (
" hello "), which breaks equality checks; Options Trim and Normalize removed them.<a></a>and<b/>gave"", but<c> </c>gave" ". SOAP and other namespaced XML keep prefixes in key names (soap:Envelope,m:Price), so use brackets:{{ $json["soap:Envelope"]["soap:Body"] }}. CDATA was unwrapped to plain text, and a UTF-8 BOM or blank lines before the XML declaration were fine.JSON to XML: root, attributes and one document per item
JSON to XML used
rootas the root element and repeated the tag for arrays (<tags>a</tags><tags>b</tags>). A single top-level key became the root itself. Root Name and Headless set your own root and remove the<?xml?>line. A$key becomes attributes and_the text.&and<were escaped (or wrapped with the CDATA option).nulland""became empty tags,0andfalsewere kept. Each input item became its own XML document, so aggregate first if you need one file. Keys with a space or starting with a digit failed withInvalid character in name, and a round trip lost types:19.9came back as"19.9".
What we ran
On 24 October 2026 we ran 39 executions on self-hosted n8n 2.43.7 with n8n execute: Manual Trigger, a Code node with test XML or JSON, optionally Extract From File, the XML node (v1, the only version), optionally Split Out, and a Code node that recorded the output.
| Setup | Result |
|---|---|
| Binary .xml file straight into the XML node | Error: Item has no JSON property called "data" |
| Extract From File (Extract From XML), then XML node | Parsed fine |
HTTP response in a field named body, Property Name left at data | Error: Item has no JSON property called "data" |
Same, Property Name set to body | Parsed fine |
Default options, 2 <item> elements | item is an array of 2 objects |
Default options, 1 <item> element | item is a plain object, not an array |
Split Out on rss.channel.item, 2 items | 2 correct items |
Split Out on rss.channel.item, 1 item | 3 junk items: the object's fields split apart |
| Explicit Array on | Every value wrapped in an array, even ["Shop"] |
Attribute currency="EUR" on <price>19.90</price> | {"_":"19.90","currency":"EUR"} |
| Merge Attributes off | Attributes under $ |
| Ignore Attributes on | Attributes dropped, price is plain "19.90" |
| Explicit Root off | Outer rss key removed |
Numbers such as 0042 and 19.90 | Strings: "0042", "19.90" |
| Normalize Tags on | Names lowercased: ItemName becomes itemname |
HTML with <br> | Error: Unexpected close tag |
| A JSON string | Error: Non-whitespace before first tag. (Char: {) |
| An object field instead of a string | Same error, Char: [ (it became [object Object]) |
Bare & as in Tom & Jerry | Error: Invalid character in entity name |
| Truncated XML | Error: Unclosed root tag |
| Empty string | Error: Cannot read properties of null (reading '$error') |
| Parse error with On Error set to Continue | 0 items, green run, no error field |
| Spaces and newlines inside tags, default options | Kept: " hello " |
| Trim and Normalize on | Whitespace removed |
<a></a>, <b/>, <c> </c> | "", "", " " |
| SOAP envelope with namespaces | Keys like soap:Envelope and m:Price, plus xmlns:* keys |
| CDATA section | Plain text, CDATA removed |
UTF-8 BOM or blank lines before <?xml | Parsed fine |
| ISO-8859-1 file through Extract From File | Café came out correct |
| JSON to XML, default | Root element root, arrays repeat the tag |
| JSON to XML, one top-level key | That key becomes the root element |
Root Name order + Headless | No <?xml?> line |
$ key and _ key | Attributes and element text |
& and < in values | Escaped; CDATA option wraps them instead |
null and ""; 0 and false | Empty tags <a/>; kept as 0 and false |
| 2 input items | 2 separate XML documents, not one |
| Key with a space or starting with a digit | Error: Invalid character in name |
| Round trip JSON to XML to JSON | 19.9 became "19.9", a one-element array became a string |
Good to know
- XML from an API? See n8n HTTP Request node errors. Reading files: Extract From File not working and binary data not found. Splitting the result: Split Out, Aggregate and Summarize. Scraping web pages: HTML is not XML, use the HTML node.
- Every error message we reproduced is in the n8n error message index.
What we didn't test
- The editor UI itself (we ran workflows from JSON), n8n Cloud, very large files and live SOAP or RSS endpoints: we used local test XML.
Start from a working agent
FAQ
Why does the n8n XML node say Item has no JSON property called "data"?
The XML node reads a text field named in Property Name, data by default. You either sent it a binary file (add Extract From File, Extract From XML, first) or your XML is in another field such as body, so set Property Name to that field.
Why does Split Out break when my XML has only one item?
With default options one element becomes an object, not an array, so Split Out splits its fields. Turn on Explicit Array in the XML node options, or wrap the field in an expression with [].concat().
What does "Non-whitespace before first tag" mean in n8n?
The input doesn't start with an XML tag. In our runs it was a JSON string (Char: {) or an object field that became [object Object] (Char: [). If the API returns JSON, skip the XML node.
Why is my XML value an object with an underscore in n8n?
The element has attributes. Its text goes under _ and the attributes become keys, so use $json.price._ or turn on Ignore Attributes.
Why are numbers strings after the n8n XML node?
XML has no types, so every value is a string, and leading zeros are kept. Convert with Number() or Edit Fields before comparing.
How do I make one XML file from many items in n8n?
JSON to XML turns each item into its own document. Combine the items first with Aggregate or a Code node, then convert once.
Related guides
- n8n MongoDB node errors: Authentication failed, Invalid JSON and query fixes, 40 runs
- n8n Extract From File (CSV) not working: delimiter, BOM, encoding and errors, 32 runs
- n8n Compression node not working: zip, unzip, file_0 and invalid zip data, 42 runs
- n8n HTML Extract not working: empty values, selectors and errors, 32 runs
- n8n Code node errors: "Code doesn't return items properly" and 10 more, fixed
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes