developers.do

XML ↔ JSON Converter

Bi-directional converter between XML and JSON using a familiar convention: @attr for attributes and _text for content; repeated tags collapse to arrays

DOMParser is not defined

Convention: attributes become @attr keys, text content becomes _text, and repeated child tags become arrays. Whitespace-only mixed content between elements is trimmed. Round-tripping JSON output back to XML produces equivalent structure.