XML to YAML: A Simple Subset for Everyday Snippets
XML is verbose and YAML is terse. For small configs, a simple element-to-mapping conversion is all you need to compare them.
What is the XML to YAML Converter?
This converter covers a simple, everyday subset of XML: elements with text, nested elements, and basic attributes. It walks the tag tree and writes YAML with indentation showing the same nesting, so a small config or data snippet becomes readable in a YAML-style layout. Complex XML with namespaces, mixed content, or repeated list elements may need a fuller parser, which is why this tool is labelled as a subset.
How to use it
- Paste simple XML with nested elements.
- Click Convert to YAML.
- Check the indentation matches the XML nesting.
- Copy the YAML for your config or notes.
Worked example
A person element with name Ada and age 36 becomes YAML with person, name, and age keys at matching depths.
How do I turn simple XML into YAML?
Walk the element tree and write each element as a YAML key, indenting children under their parent and keeping text as the value.
Frequently asked questions
Which XML does this subset cover?
Elements with text, nested elements, and simple double-quoted attributes.
What about namespaces or mixed content?
Those fall outside this simple subset and may not convert faithfully; use a full XML parser for them.