# JSON to XML

Convert JSON into indented XML. "@name" keys become attributes and arrays repeat the tag.

- Endpoint: `POST https://setget.net/v1/tools/json-to-xml` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `json-to-xml`
- Page: https://setget.net/tools/json-to-xml

## Inputs

- `text` (required, string): The JSON to convert.
- `root` (optional, string, default `"root"`): Root tag name, used when the JSON is not an object with a single key.

## Example

```json
{"input":{"text":"{\"user\":{\"@id\":\"7\",\"name\":\"Sam\",\"tag\":[\"a\",\"b\"]}}"}}
```

Result:

```json
{"text":"<user id=\"7\">\n  <name>Sam</name>\n  <tag>a</tag>\n  <tag>b</tag>\n</user>"}
```
