YAML to XML

Convert YAML into well-formed XML: keys become elements and lists become repeated elements, with special characters escaped correctly. Useful for feeding YAML config into XML-based systems. Runs in your browser.

Suggested tools

XML to YAML

Convert XML into YAML.

XMLYAML
Open Tool

JSON to YAML

Convert JSON into readable YAML.

JSONYAML
Open Tool

YAML to JSON

Convert YAML into JSON.

YAMLJSON
Open Tool

YAML Formatter

Re-indent YAML and check it for syntax errors, with line numbers.

YAML
Open Tool

YAML to CSV

Convert a YAML list into CSV.

YAMLCSV
Open Tool

CSV to YAML

Convert CSV into YAML.

CSVYAML
Open Tool

About YAML to XML

YAML to XML converts YAML data into well-formed XML. Keys become elements, lists become repeated elements, and characters such as & and < are escaped correctly, so the output can be loaded by any XML parser.

It is useful when a system only accepts XML — older APIs, SOAP services, some CI tools — but you prefer to write your data in YAML. Everything runs locally in your browser — the text you paste is never uploaded.

How to use YAML to XML

  1. Paste YAML or upload a .yaml file.
  2. Press Convert.
  3. Copy or download the XML.

Key features

  • Keys become elements, lists become repeated elements
  • Special characters escaped
  • YAML syntax checked first, with line numbers
  • Supports anchors and merge keys (<<)

Example

The list becomes repeated <items> elements.

Input
invoice:
  number: INV-2041
  items:
    - Pen
    - Notebook
Output
<invoice>
  <number>INV-2041</number>
  <items>Pen</items>
  <items>Notebook</items>
</invoice>

When to use YAML to XML

  • Feeding YAML configuration into systems that only accept XML.
  • Generating XML test data from readable YAML.
  • Converting between config formats during a migration.

Tips and common problems

  • Use a single top-level key to name the root element.
  • Prefix keys with @_ to create XML attributes.
  • Keys with spaces or starting with a digit are renamed to valid XML names.

Frequently asked questions

Prefix a key with @_ (for example "@_id: 5") and it becomes an attribute of its parent element.