XML to CSV
Convert repeated XML elements to CSV rows. Paste XML on the left; the CSV output builds on the right as you type.
<orders>
<order><id>1</id><name>Ada Lovelace</name><role>engineer</role></order>
<order><id>2</id><name>Grace Hopper</name><role>engineer</role></order>
</orders>
becomes
id,name,role
1,Ada Lovelace,engineer
2,Grace Hopper,engineer
XML always parses with its root tag as a wrapper, so <orders> produces { "orders": { "order": [...] } } internally, two levels of wrapping around the actual list. The converter follows that chain automatically: a single key leading to another single key leading to an array counts as “the list,” and each order becomes one row with id, name, and role as columns.
When there’s no list to find
If the XML has no repeated element, there’s nothing to unwrap, and the whole document becomes one row instead, with nested elements flattened into dotted columns exactly like converting a single JSON object to CSV. A warning appears below the output whenever the unwrap step actually finds and uses a nested list, so you can tell which behavior applied.
Attributes become columns
An attribute like <order id="1042"> becomes a column named @_id, since the XML to JSON step that runs first turns every attribute into an @_-prefixed key before the CSV builder sees it.
Multiple nesting levels
Ambiguous documents, where the path to the list passes through an element with more than one child type, don’t unwrap automatically; the converter only follows a chain where each step has exactly one key, so it can’t misidentify a sibling as part of the list. Restructure the XML, or convert to JSON with the XML to JSON converter and edit the shape there before converting to CSV.