Skip to content
yutils
Example

Input (XML)

<user>
  <name>yutils</name>
  <tags>
    <tag>tools</tag>
    <tag>dev</tag>
  </tags>
</user>

Output (JSON)

{
  "user": {
    "name": "yutils",
    "tags": {
      "tag": ["tools", "dev"]
    }
  }
}

Note

Repeating tags (`<tag>`) become arrays. Attributes appear as `@_attr` (configurable). Round-trip conversion supported.

Usage / FAQ

When to use

  • Feed legacy SOAP / RSS / sitemap.xml data into a JSON pipeline
  • Convert JSON to XML for systems that still require XML (rare but real)
  • Quickly inspect XML from Android, iOS, or older enterprise systems
  • Cross-convert OpenAPI / AsyncAPI XML and JSON definitions
  • Normalize scraped XML to JSON for downstream `jq` processing

FAQ

Q.How are attributes represented?
A.As keys prefixed with `@_` (e.g. `<a href="...">` becomes `{"a": {"@_href": "..."}}`). The prefix is configurable.
Q.What if a repeating tag only appears once?
A.By default it becomes a single object. Enable always-array mode if you want it forced into an array — downstream code stays consistent.
Q.What about comments and CDATA?
A.Dropped by default. Enable the preservation option to keep them as separate fields.