• Here's a real world situation. I have a web based application that tracks games and points for a poker league. There are certain things that are easiest entered into the backend database using a bulk import.

    The poker league is hosted on a provider that does not allow file upload. My current solution uploads player statistics into a MemoryStream object which is converted into an XmlDocument to process into the database. The XML datatype may have been a solution if I needed to keep a copy of the actual uploaded file?

    The XML part of the solution is a vast improvement over CSV because of the data typing and heirarchy that the XML allows. 

    Season--Location--Game--Players--Player--Points

    Without getting too involved in my own solution, the XML hierarchy allows me to put these records into the database in a transaction with rollback and commit features.  I can validate the entire tournament against specific rules. Rules like, you can't have two players in first place. You can only play at one table during a round. So, it takes advantange of the self-describing, self-validating features of XML.

    Here's an interesting side effect of this XML file. If I wanted to display the touranment results, I could generate the same XML document and use a style sheet to display it as a web page.  Or, I could store the file as XML in the database...which I am not currently doing.

    VARCHAR(8000) is sufficient to handle this situation. The XML datatype could offer an additional schema stamp of authentication to the document. Currently, the benefits don't outweigh the hassle.