{"uid":"cap__5JV-Sd2sInw1l8X_nrVo","slug":"agent402-tools-json-to-xml-converter-e301bb2b","name":"agent402.tools JSON to XML Converter","description":"Convert a JSON value to indented XML — the reverse of xml-to-json. Objects become nested elements, arrays repeat their tag, and text is escaped. Deterministic.","url":"https://agent402.tools/api/json-to-xml?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"data":{"description":"the JSON value to serialize"},"root":{"type":"string","description":"name of the wrapping root element (default: root)"}}},"responseSchema":{"type":"json","example":{"xml":"<root>\n  <book>\n    <title>x</title>\n  </book>\n</root>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_35CjuE5JHsUr5eh9IVtPa","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a JSON value to indented, well-formed XML with configurable root element name","exampleAgentPrompt":"Can you convert this JSON object to indented XML for me, wrapping everything in a root element called 'catalog'? Here's the data: {\"items\":[{\"id\":1,\"name\":\"Widget\"},{\"id\":2,\"name\":\"Gadget\"}]}","exampleUseCases":null,"resultDescription":"Returns a well-formed, indented XML string where JSON objects become nested elements, JSON arrays repeat their parent tag for each element, and special characters in text nodes are properly escaped. The output is wrapped in the specified root element (defaults to 'root' if not provided).","failureModes":["Invalid or malformed JSON input — service may return an error or unexpected output","Missing 'data' field in request body — results in an error response","Very deeply nested JSON may produce verbose XML output","Circular references in JSON objects will likely cause serialization errors"],"whenToPreferThis":"Use this endpoint when you need a deterministic, reproducible JSON-to-XML conversion without running code locally — especially useful in agentic pipelines that require XML output for downstream systems, legacy integrations, SOAP services, or XML-based configuration formats. Prefer this over general-purpose code execution when you want a reliable, consistent transformation with proper escaping and indentation guaranteed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T00:59:10.080Z","isFirstParty":false,"canonicalSlug":"agent402-tools-json-to-xml-converter-e301bb2b"}