{"uid":"cap_ejbE32icvud0-jNixaVG4","slug":"agent402-tools-xml-to-json-converter-2e7ae875","name":"agent402.tools XML to JSON Converter","description":"Parse XML into a JSON object tree (attributes under _attrs, text under _text; repeated elements become arrays).","url":"https://agent402.tools/api/xml-to-json?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"xml":{"type":"string","description":"XML text (max 100KB)"}}},"responseSchema":{"type":"json","example":{"json":{"user":{"name":"Ada","_attrs":{"id":"1"}}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_q7by05G1Dcc-Ca39S83IB","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses an XML string into a structured JSON object tree, with attributes under _attrs and text content under _text, and repeated elements converted to arrays.","exampleAgentPrompt":"Convert this XML into a JSON object for me: '<root><item id=\"1\"><name>Widget</name></item><item id=\"2\"><name>Gadget</name></item></root>' — I need attributes under _attrs and text under _text.","exampleUseCases":null,"resultDescription":"A JSON object tree representing the parsed XML structure, where XML attributes are stored under _attrs keys, text content under _text keys, and repeated sibling elements are collapsed into arrays. The response allows downstream code to navigate the former XML hierarchy as native JSON.","failureModes":["Malformed or invalid XML returns a parse error","XML payload exceeding 100KB may be rejected","Missing or empty 'xml' field results in a validation error","Extremely deeply nested XML may hit recursion limits","Non-UTF-8 encoded XML may fail to parse"],"whenToPreferThis":"Use this endpoint when you have an XML string (e.g. from a legacy API, RSS feed, SOAP response, or config file) and need it converted to a navigable JSON structure with consistent attribute and text conventions (_attrs/_text). Prefer this over manual parsing or regex-based extraction when you need a reliable, structured tree rather than flat key-value extraction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:17:55.560Z","isFirstParty":false,"canonicalSlug":"agent402-tools-xml-to-json-converter-2e7ae875"}