# XML to JSON

Convert XML into JSON. Attributes become "@name" keys and repeated tags become arrays.

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

## Inputs

- `text` (required, string): The XML to convert.
- `indent` (optional, integer, default `2`, range 0..8): Spaces per level. 0 gives one compact line.

## Example

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

Result:

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

**How are attributes represented?** As keys starting with "@". Text next to child elements is stored under "#text".
