Flattened XML rows
- Input
- JSON record had customer.name Ada, customer.city München, tags ["priority","quoted, comma"], and zip "02134".
- Output
- XML wrote <customer.name>Ada</customer.name>, <customer.city>München</customer.city>, and <zip>02134</zip>.
JSON to XML is a table-shaped conversion: objects are flattened into columns first, then each record is serialized as a repeated XML row.
From real runs
| Element | Result | What happens |
|---|---|---|
| Record array | Kept | The two JSON records became two repeated XML row elements under one rows root. |
| Nested object keys | Changed | Nested customer fields were emitted as elements named customer.name and customer.city. |
| Arrays | Changed | The tags array became escaped JSON text inside a tags element, not repeated child elements. |
| Null values | Changed | JSON null values were written as self-closing XML elements such as <empty/>. |
| String IDs | Kept | The id and zip strings kept their leading zeroes because JSON typed them as strings. |
| Unicode text | Kept | München, Zoë, and 東京 were readable in the XML output without entity replacement beyond XML syntax escaping. |
The two JSON records became two repeated XML row elements under one rows root.
Nested customer fields were emitted as elements named customer.name and customer.city.
The tags array became escaped JSON text inside a tags element, not repeated child elements.
JSON null values were written as self-closing XML elements such as <empty/>.
The id and zip strings kept their leading zeroes because JSON typed them as strings.
München, Zoë, and 東京 were readable in the XML output without entity replacement beyond XML syntax escaping.
We converted our JSON sample (557 B) with Table engine on 2026-09-11. It took 1 ms and produced a 694 B XML file, 1.2× larger than the input. The engine raised no warnings.
Input · sample.json · 557 B
Array of 4 objects; keys: company, stage, arr, owner, close_date
Output · sample.xml · 694 B
25 elements, root <rows>
First lines of the output
<rows>
<row>
<company>Northwind Traders</company>
<stage>Proposal</stage>
<arr>48000</arr>
<owner>R. Ayers</owner>
<close_date>2026-10-14</close_date>
</row>
<row>
<company>Contoso Ltd</company>
<stage>Negotiation</stage>
<arr>120000</arr>
<owner>P. Ng</owner>
<close_date>2026-09-30</close_date>
</row>
<row>
<company>Fabrikam</company>
<stage>Qualified</stage>
…Python json and ElementTree
python - <<'PY'
import json, xml.etree.ElementTree as ET
data = json.load(open("input.json", encoding="utf-8"))
root = ET.Element("rows")
for record in data:
row = ET.SubElement(root, "row")
for key, value in record.items():
ET.SubElement(row, key).text = "" if value is None else str(value)
ET.ElementTree(root).write("output.xml", encoding="utf-8", xml_declaration=True)
PYThis snippet does not flatten nested dictionaries or validate XML element names.
The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=json&to=xml.
curl -X POST https://filetypeconverters.com/api/v1/convert \
-H "Authorization: Bearer $FTC_API_KEY" \
-F "file=@input.json" -F "from=json" -F "to=xml" \
-F 'options={"encoding":"utf-8"}' \
--output output.xml| Key | Applies to | Type | Default |
|---|---|---|---|
| encoding | Reading JSON | utf-8 · latin1 | utf-8 |
| flattenSeparator | Reading JSON | string | . |
| arrayMode | Reading JSON | json · explode | json |
| delimiter | Writing XML | string | , |
| newline | Writing XML | · | |
| sheetName | Writing XML | string | |
| dialect | Writing XML | postgres · mysql · sqlite | postgres |
| tableName | Writing XML | string | data |
| createTable | Writing XML | boolean | true |
Not in this tabular route. Nested JSON is flattened before XML is written, so customer.name becomes a single element name.
By default they become JSON strings inside one XML element. Our tags array was escaped as text rather than expanded into repeated tags.
Yes. The rowElement write option changes the repeated item name, while the rows wrapper stays the writer's top-level container.