# XML to JSON Converter with Validation

> XML to JSON Converter with Validation is a paid API for AI agents from toolbelt402.tpoborne.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Parses XML into JSON with line-numbered validation errors, attribute preservation, and optional type coercion — supports RSS, sitemaps, and SOAP-style payloads.

## Facts

- Endpoint: POST https://toolbelt402.tpoborne.workers.dev/xml/to-json?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/xml-to-json-converter-with-validation-947fd313
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A50-yaZVOyezfTPfHvTHq

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 xml-to-json-converter-with-validation-947fd313 -d '<json body>'
```

Example prompt: Can you parse this XML into JSON for me? It's an RSS feed — make sure to preserve the attributes and coerce numeric values to their proper types. Here's the XML: <rss version="2.0"><channel><title>My Feed</title><item><pubDate>2024-01-01</pubDate><count>42</count></item></channel></rss>

## When to prefer this

Choose this endpoint when you need to convert XML — especially RSS feeds, sitemaps, or SOAP-style responses — into JSON with reliable validation feedback and attribute preservation. It's ideal for agentic pipelines consuming legacy XML APIs or feed data where you need structured JSON output and want errors surfaced with precise line numbers rather than silent failures. Prefer it over general-purpose XML libraries when you want a stateless, pay-per-call microservice without managing dependencies.

## Known failure modes

- Malformed XML returns validation errors with line and column numbers rather than a parsed result
- Deeply nested or extremely large XML documents may hit payload size limits
- Namespace-heavy SOAP documents may produce verbose or unexpected key naming
- Missing or empty input body returns an error indicating no XML was provided
- Type coercion may produce unexpected results for ambiguous string values like '01' (could be number or string)

## How this service works

Parse XML into JSON — validates first with line-numbered errors, preserves attributes, optional type coercion. Works for RSS feeds, sitemaps, and SOAP-ish payloads.

## Output

Returns a JSON object representing the parsed XML structure, with element attributes preserved as JSON properties, optional type coercion applied to numeric and boolean leaf values, and detailed line-numbered validation errors if the XML is malformed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "xml": {
   "type": "string",
   "description": "XML text (max 256 KB); validated before parsing"
  },
  "options": {
   "type": "object",
   "properties": {
    "typed": {
     "type": "boolean",
     "description": "coerce numeric tag values (default true)"
    },
    "attributes": {
     "type": "boolean",
     "description": "keep attributes as @_ keys (default true)"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/xml-to-json-converter-with-validation-947fd313/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
