REST to XML Payload
REST API payloads convert to XML with namespace and attribute support for enterprise integration.
Switch tool:
Examples:
XML output will appear here...
💡 Paste your JSON and it converts to XML automatically. Properties starting with @ become XML attributes.
Code Examples
Here's how to achieve this in different programming languages:
1// Using xmlbuilder2 (npm install xmlbuilder2)2const { create } = require('xmlbuilder2');34const jsonData = {"request": {"@xmlns": "http://api.example.com", "@action": "create", "user": {"name": "John", "email": "john@example.com"}}};56const xml = create({ version: '1.0', encoding: 'UTF-8' })7 .ele(jsonData)8 .end({ prettyPrint: true });910console.log(xml);1112// Output:13// <?xml version="1.0" encoding="UTF-8"?>14// <request xmlns="http://api.example.com" action="create">15// <user>16// <name>John</name>17// <email>john@example.com</email>...
More JSON Examples
Simple JSON to XML
Basic JSON object conversion to XML elements.
JSON to XML Attributes
JSON with @ prefixed properties converted to XML attributes.
JSON Array to XML
JSON arrays converted to repeated XML elements.
Nested JSON to XML
Deeply nested JSON structures converted to nested XML.
JSON Config to XML
Transform JSON configuration files to XML format.