Converts between JSON and XML. This Processor wraps Newtonsoft.Json.JsonConvert.DeserializeXmlNode  and Newtonsoft.Json.JsonConvert.SerializeXmlNode  in Json.NET

Revision History Long, long ago, a version far away Prevented automatic timezone conversion of date types in JSON values



Type: List Input
JsonToXml - Convert JSON to XML
XmlToJson - Convert XML to JSON
Action to perform


Type: Multiline Text InputOutput
If Action is JsonToXml, provide the input JSON here. If Action is XmlToJson, this property returns the converted JSON.


Type: Xml InputOutput
If Action is XmlToJson, provide the input XML here. If Action is JsonXmlTo, this property returns the converted XML.


Use this Processor to easily convert between JSON and XML.

In XML to JSON conversion, XML attributes and namespaces will be lost.


XmlNodeConverter can only convert JSON that begins with an object.

Because XML requires a single root Node and requires a name for all nodes, the JSON passed in for conversion will need to prepared appropriately in some cases. Specifically, the entire JSON value should always be encapsulated in curly braces and all nodes should be named.

Here are some examples of invalid JSON documents:

  • "key" : "some string" should be { "key" : "some string"} 

  • [ { "key" : 1 }, { "key" : 2 } ]  should be { "root": [ { "key" : 1 }, { "key" : 2 } ] } 

Use the Formatter Node to prepare an appropriate JSON string before passing to this Node.

Emitting Arrays

XML has no equivalent to a JSON array. However, Json.NET supports a special XML attribute to force an element to render as a JSON array:

<root xmlns:json="">
    <attributes json:Array="true">
    <name>Item Code</name>
  <attributes json:Array="true" >

Non-string Types

Without an XML Schema, it is not possible to infer types for XML elements. Thus, all element values are rendered as JSON strings.

To work around this problem, wrap numeric and boolean values in an escape tag, then use the Replace Node to remove the escape sequence along with the enclosing quotes.


When converted to JSON, the following is returned:


Use the Replace Node to replace "{{  and }}" with an empty string.

Did this answer your question?