XML Node

Convert between XML and JSON data formats

Written By pvdyck

Last updated About 5 hours ago

XML Node

The XML node converts data between XML and JSON formats for interoperability with APIs and services that use XML.

Modes

ModeDescription
JSON to XMLConvert a JSON object into an XML string
XML to JSONParse an XML string into a JSON object

Parameters

ParameterDescription
Input FieldThe field containing the data to convert
Destination FieldThe field name for the converted output

JSON to XML Options

OptionDescription
HeadlessOmit the XML declaration (<?xml ...?>) from output
Root NameCustom name for the root XML element (default: root)
Attribute CharacterCharacter prefix for attribute fields (default: $)
Character KeyKey name for text content in mixed elements (default: _)
Render CDATAWrap text content in CDATA sections

XML to JSON Options

OptionDescription
Explicit ArrayAlways put child nodes in arrays, even when there is only one
Explicit RootInclude the root element in the JSON output
Normalize TagsLowercase all tag names
TrimRemove leading/trailing whitespace from text content
Merge AttributesMerge attributes into child elements instead of a separate $ object
Ignore AttributesDiscard all XML attributes during parsing

Tips

  • Use the Attribute Character option to control how XML attributes map to JSON keys
  • Enable Explicit Array for consistent parsing when XML element counts vary
  • Combine with HTTP Request node to call SOAP/XML APIs

Limitations

  • Very large XML documents may impact execution performance
  • XML namespaces are preserved but may require manual handling in subsequent nodes

Related