XML to Text Converter

Flatten XML into one line per value, written as an element path and its content, for searching and quick reading.

XML
Paths and values
Runs locally in your browser

About the XML to Text Converter

Sometimes you only want the values: the text of every leaf element and every attribute, each with enough of a path to know where it came from. This converter walks the document and writes lines such as catalog/book/title = The Lighthouse Keeper and catalog/book/@id = bk101, in document order.

The path format is a simplified XPath: element names separated by slashes and attributes marked with @. Repeated elements share the same path, which keeps lines short; if you need positions, the XPath Tester can address them with an index.

It is a one-way conversion intended for reading, grepping and pasting into tickets, not for round-tripping. To strip markup and keep only the readable prose of a document, the HTML to Text tool works on XML too.

How to use

  1. Paste XML on the left.
  2. Search the lines on the right for the value you need.
  3. Copy or download the list.

Common questions

Can the output be converted back to XML?
No. Structure such as element order and repetition is not fully recoverable from the flat list.
Are attributes included?
Yes, each attribute gets its own line with an @ before its name.
How are empty elements shown?
As the path with an empty value after the equals sign.