# XML to JSON Converter

> XML to JSON Converter is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-12-03).

Converts an XML document string to a structured JSON object, mapping attributes to @name keys and text to #text keys, with repeated elements becoming arrays.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/xml/to-json?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-xml-to-json-converter-1c134e7c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C1xG1UgQAvMS_7Q5ZnLIs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent-data-tools-revmesh2074-workers-dev-xml-to-json-converter-1c134e7c
```

Example prompt: Convert this XML into JSON for me: <order id="42"><item sku="A1">Widget</item><item sku="B2">Gadget</item></order> — I need attributes as @id/@sku keys and repeated items as an array.

## When to prefer this

Choose this endpoint when you need a secure, predictable XML-to-JSON conversion with a consistent mapping convention (attributes as @name, text as #text, repeated elements as arrays) and explicit XXE/DOCTYPE protection. Ideal for processing RSS feeds, SOAP responses, and XML config files inside an agent workflow without needing a local XML parser or library.

## Known failure modes

- DOCTYPE declarations in the XML are refused with an error — external entity loading is blocked by design
- External entity references (XXE) are rejected for security
- Input XML exceeding 100,000 characters is rejected
- Malformed or invalid XML returns a parse error
- XML with encoding issues or binary content may fail to process

## How this service works

XML to JSON for any XML document: attributes become "@name" keys, text becomes "#text" (or the value itself when an element only holds text), and repeated child elements become arrays. DOCTYPEs and external entities are refused, so nothing outside the document is ever loaded. Up to 100,000 characters. Use to read XML feeds, SOAP responses and config files in an agent.

## Output

Returns a JSON object with a 'json' key containing the parsed structure (attributes as @name keys, text content as #text or the value itself for text-only elements, repeated sibling elements as arrays) and a 'root' key with the root element name.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "xml"
 ],
 "properties": {
  "xml": {
   "type": "string",
   "description": "The XML document"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "object",
   "properties": {
    "order": {
     "type": "object",
     "properties": {
      "@id": {
       "type": "string"
      },
      "item": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "@sku": {
          "type": "string"
         },
         "#text": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "root": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-xml-to-json-converter-1c134e7c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
