When and Why is XML preferable to CSV?

Nick picture Nick · Nov 30, 2009 · Viewed 77k times · Source

sometimes it feels like XML has been used just because it was fashionable.

Answer

Robert Koritnik picture Robert Koritnik · Nov 30, 2009

Some strengths:

  • You can validate XML data against XSD
  • You can easily provide contracts (as XSD) to other parties that should either create/consume XML data, without literally describing them
  • You can have one to many relations in multi-levels in XML data representation
  • XML is arguably more readable than CSV
  • XML is natively supported by the .net framework

To name a few from the top of my head.