How are XML attributes represented in the JSON output?
XML attributes are emitted as JSON keys prefixed with "@". For example, <book id="b-001"> becomes "@id": "b-001" inside the book object. This is the convention used by Microsoft, Badgerfish, and most XML-to-JSON libraries — it lets attributes coexist with child elements and the element's text content without name collisions.
What happens to XML namespaces during conversion?
Namespace prefixes are kept verbatim in the JSON keys. <dc:title> becomes "dc:title": "...". The xmlns:dc declaration on the root element is preserved as "@xmlns:dc". This keeps the data round-trippable and avoids ambiguity when the same local name (e.g. title) appears in multiple namespaces.
Are CDATA sections preserved or unwrapped?
The DOM parser unwraps the CDATA wrapper and exposes the inner text as the element's textContent — exactly what most consumers want. So <description><![CDATA[a & b]]></description> becomes "description": "a & b" in the JSON. The literal markup characters inside the CDATA are kept as-is, not re-escaped.
How does the converter handle repeated sibling elements?
When the same tag name appears more than once at the same level, the values are collected into a JSON array. A single <author> becomes "author": "Andy Hunt"; two <author> elements become "author": ["Andy Hunt", "Dave Thomas"]. This matches how kubectl, Spring, and most XML-aware libraries treat repeated children.
What about mixed content — elements with both text and child elements?
When an element contains both a text node and child elements, the text is emitted under the "#text" key alongside the child element keys. This is lossy in one direction (whitespace ordering between siblings is not preserved) but it keeps the JSON tree well-formed and easy to consume.
Will the output round-trip back to the original XML?
For data-style XML (config files, SOAP responses, structured records) the round-trip is faithful when you use a JSON-to-XML tool that respects the @-prefix and "#text" conventions. For document-style XML with significant whitespace, processing instructions, or comments, those non-element nodes are dropped — JSON has no equivalent.
Is my XML uploaded to a server during conversion?
No. The conversion uses the browser's built-in DOMParser entirely on your machine. SOAP envelopes, signed SAML assertions, internal API responses, and credential-laden XML never leave your device. Open DevTools → Network and click Convert to verify.
How do I convert SOAP XML responses to JSON?
Paste the full SOAP envelope (<soap:Envelope>...</soap:Envelope>) and click Convert. The result is a deeply nested JSON object reflecting the envelope, header, and body structure. To extract just the payload, drill into result["soap:Envelope"]["soap:Body"] in your code — or strip the envelope before pasting.