What XML is
XML marks up data with nested named tags and optional attributes. It is verbose, strict about being well-formed, and can carry a schema that says what shape a document must have.
Enterprise integrations, government data feeds, RSS, SOAP services and older document formats.
What CSV is
CSV is a text file where each line is a row and commas separate the fields. There is no type system, no formatting and no second sheet. Every value is text until something downstream decides otherwise.
Almost every database, analytics tool and spreadsheet can read and write it, which is why exports default to it.
What changes when you convert XML to CSV
The first repeating element is treated as the rows. Attributes are read alongside child elements and prefixed so they do not collide with a same-named tag. Nesting one level deep becomes dotted column names; deeper structures are kept as text.
Any value containing the delimiter, a quote or a line break gets wrapped in quotes, and embedded quotes are doubled. That is the rule in RFC 4180 and it is what spreadsheet software expects.
Column names come from the element names, which means they inherit whatever naming convention the feed uses. A feed written by a Java service will hand you camelCase headers, and one from an older system will hand you underscores.
Attributes become their own columns rather than being dropped. In a lot of XML the useful identifiers are attributes, so losing them would lose the key.
Namespaced tags keep their prefix in the column name. A tag written as ns:price becomes a column called ns:price, which is ugly but unambiguous.
What carries over from XML to CSV
XML records 2 things about a table that CSV has no way to hold.
An empty cell and a missing one are the same thing in CSV, so a null and an empty string in the XML both come out blank and can no longer be told apart.
XML can hold a value that is itself a list or an object. CSV has only flat cells, so nested values are flattened into one cell rather than being spread across columns.
The keys stop being repeated: CSV writes the column names once at the top, so the same table takes noticeably less space.
The identifier 007 comes out of the CSV as 007. Reading it as a number would have made it 7, and an id that changes value is worse than one that stays text.
The role "Analyst, data" survives with its comma, in one cell rather than split across two. That is the first thing to check in any converted table, and the usual place a CSV file goes wrong.
The quotes around Jonah "Jo" Pryce are doubled, which is how the delimited formats escape a quote in the CSV.