YAML to XML
Convert YAML to XML. Paste YAML on the left; the XML output builds on the right as you type.
order:
"@_id": "1042"
status: shipped
items:
- pen
- notebook
becomes
<?xml version="1.0" encoding="UTF-8"?>
<order id="1042">
<status>shipped</status>
<items>pen</items>
<items>notebook</items>
</order>
order is the single top-level key, so it becomes the root element. The @_id key becomes an id attribute, and each list item under items becomes its own <items> element, since XML represents repetition with repeated tags rather than a list syntax.
One shared engine, not a special case
This pair doesn’t get its own conversion logic. YAML parses to the same plain value that JSON, TOML, or CSV would produce for equivalent data, and the XML builder works from that value without knowing or caring which format it came from. That’s also why quoting a YAML key like "@_id" matters here: YAML would otherwise try to parse the leading @ as part of a tag directive in some contexts, so quoting keeps it a plain string key.
Comments don’t survive
YAML comments are gone by the time the value reaches the XML builder, since comments never make it past the parsing step, the same as YAML to JSON. If you need to keep notes alongside the config, XML comments (<!-- like this -->) would need to be added back in manually after conversion.
Round-tripping
Converting YAML to XML and then that XML back to YAML with the XML to YAML converter won’t necessarily produce byte-identical YAML: attribute ordering, quoting style, and block versus flow YAML style can all differ even when the underlying data is the same.