Source text
Paste text or upload a file
Result
Type is not detected yet
Statistics appear after formatting
Builds an XML tree from a JSON object: the root element name comes from the single top-level key, and everything else becomes child elements.
When the object has a single top-level key (like book in the example), that key becomes the root tag name. The special @attributes key becomes the element's XML attributes, #text becomes its text content, and every other key becomes a child element.
Key names are cleaned of characters that aren't valid in XML tags (spaces and special characters become _), and any key starting with "xml" gets a prefix, since that's reserved by the XML spec. An array value becomes several repeated elements with the same tag.