Convert YAML to XML

Turn YAML into an XML document.

XML

About this converter

Normally because something downstream takes XML and the configuration you have is YAML — an integration, an import format, a system that has not changed in fifteen years.

A document with several top-level keys gets wrapped in a <root> element, because XML allows exactly one and YAML has no such rule. A key prefixed with @_ becomes an attribute, which is the convention the XML pages here read and write.

Comments are lost — XML has comments and YAML has comments, but nothing carries them between the two, because the conversion goes through the data rather than the text.

Frequently asked questions

Why did it add a <root> element?

Because XML permits exactly one top-level element and your YAML had more than one key at the top, or was a list. Wrapping is what anyone would do by hand.

How do I produce attributes?

Prefix the key with @_ in the YAML. A key of "@_id" becomes id="…" on the enclosing element rather than a child of it.

Does what I paste get sent anywhere?

No. The conversion runs in your browser, on your own machine — which is why the result appears as you type. Nothing is uploaded and nothing is logged. That matters for this kind of tool in particular: config files and API responses are exactly the things that carry keys, hostnames and customer data.

Related tools