SQL Server 2005 marked the introduction of the native XML data type and the inclusion of the XQuery language as part of SQL Server. XQuery is a declarative query language that can be parsed, algebrized, and optimized similar to the way that the SQL language can. Although many of the same rules apply to XML and XQuery as apply to relational data, XQuery has some different rules and constructs than SQL. For example, relational sets are unordered, so an ORDER BY clause is required if you want to return rows in order, but XQuery mandates that the results be returned in document order. XML indexes exist to optimize XQuery as SQL indexes exist to optimize SQL queries.
In SQL Server 2012 SP1, Microsoft introduced an entirely different ...