EUComply

How to Convert JSON to XML

September 2026 · 4 min read · Try it in your browser →

Some enterprise endpoints, older SOAP services and Java tooling still only accept XML. When your data lives in JSON, here's the shortest path across.

The Transmute CLI (free, zero dependencies)

Given users.json:

[
  { "name": "Alice", "age": 32 },
  { "name": "Bob",   "age": 20 }
]
$ npx github:mahope/transmute users.json --output xml --pipe '[{"op":"head","n":10}]'
<?xml version="1.0" encoding="UTF-8"?>
<data>
  <item>
    <name>Alice</name>
    <age>32</age>
  </item>
  ...
</data>

Because parsing, transforming and serializing are separate steps, you can reshape before emitting XML:

$ npx github:mahope/transmute users.json     --pipe '[{"op":"filter","expr":"item.age >= 21"},{"op":"sort","by":"name"}]'     --output xml

Python equivalent

import json
from dicttoxml import dicttoxml

data = json.load(open("users.json"))
print(dicttoxml(data).decode())

pip install dicttoxml. Works, but pulls in more of your dependency tree than most one-off jobs justify.

Things that bite people

Pipelines like this — without writing a script

The Transmute CLI is free (npx github:mahope/transmute). The desktop app adds an interactive pipeline builder, live preview and batch processing — one-time $19, no subscription.

Try the live demo →   See pricing