{"uid":"cap__skN0MqOQz5winrIrFPeo","slug":"fittings-xml-to-json-converter-518075f1","name":"fittings XML to JSON Converter","description":"Convert an XML document to an ordered JSON tree with resolved namespaces, attributes, CDATA and mixed content preserved.","url":"https://fittings.sh/v1/fmt/xml-to-json","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"xml":{"type":"string","description":"XML document, up to 1000000 characters and 50000 nodes"},"preserveWhitespace":{"type":"boolean","description":"Keep whitespace-only text nodes. Default false"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0045","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.0045/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JQcAamJywINdaUT0yU1yZ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0045","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts an XML document into an ordered JSON tree with resolved namespaces, attributes, CDATA sections, and mixed content fully preserved.","exampleAgentPrompt":"Convert this XML document to JSON for me, keeping whitespace-only text nodes: <?xml version=\"1.0\"?><root xmlns:ns=\"http://example.com\"><ns:item id=\"1\"><![CDATA[Hello & World]]></ns:item></root>","exampleUseCases":[{"title":"Parse SOAP API XML response","prompt":"I got this SOAP XML response from a legacy API and need to work with it in my code — can you convert it to JSON, making sure namespaces and attributes are all preserved?"},{"title":"Transform RSS feed to JSON","prompt":"Here's an RSS feed XML — please convert it to a JSON tree so I can process the items programmatically. Keep whitespace nodes too."},{"title":"Migrate XML config to JSON","prompt":"I have this XML configuration file I need to migrate to JSON format. Can you convert it and make sure all the attributes and CDATA sections come through correctly?"}],"resultDescription":"An ordered JSON tree representation of the input XML document, with resolved namespace prefixes and URIs, element attributes included as JSON properties, CDATA sections and text nodes preserved, and mixed content (elements interspersed with text) faithfully represented. Optional whitespace-only text nodes are included or omitted based on the preserveWhitespace flag.","failureModes":["Malformed or invalid XML input returns a parse error","Input exceeding 1,000,000 characters or 50,000 nodes is rejected","Non-UTF-8 encoded XML may cause parsing failures","Payment not included or insufficient USDC balance results in 402 error","Extremely deeply nested XML may cause stack overflows or timeouts"],"whenToPreferThis":"Choose this endpoint when you need a faithful, structure-preserving XML-to-JSON conversion that handles namespaces, attributes, CDATA sections, and mixed content correctly — scenarios where naive regex or simple parsers would lose information. Ideal for processing SOAP responses, XML feeds, legacy config files, or any XML where namespace resolution matters. Prefer over generic transformation tools when correctness and ordering of the JSON tree are important.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:56:52.240Z","isFirstParty":false}