jsonecho

YAML to XML

Convert YAML into well-formed XML with your choice of root element.

Loading the tool...

How to use YAML to XML

  1. Paste your YAML.
  2. Set the root name and indentation.
  3. Copy the XML.

About YAML to XML

Some systems still insist on XML, even when your config lives in YAML. This tool reads the YAML as data and writes it as XML: mappings become nested elements, lists become repeated elements, and scalar values become text.

Keys that cannot be used as XML names are repaired automatically, so the result is always well formed. Set the root element name to match what the receiving system expects.

Frequently asked questions

How are YAML lists turned into XML?

Each list item becomes an element with the name of the key, so a list called tag with three items gives three tag elements.

Can I create attributes?

Yes. Name a key with the prefix @_, for example @_id: 7, and it is written as an attribute.

What about a list at the very top?

It is wrapped in the root element, and each entry becomes an item element.

More in Converters

All tools →