SQL Server 2005 supports native XML data by using the xml data type.
You can store XML data into a "typed" or "untyped" xml data type.
"Typed" xml data types require the assignment of a Schema Collection one or more schemas that have been stored in the SQL Server XML Schema Collection repository.
Using a Schema Collection allows you to provide multiple versions of a schema.
The query method extracts parts of an XML instance.
The value method extracts a scalar value from an XML instance.
The exist method provides an existential check on an XML instance.
The nodes method yields instances of a special XML data type, each with its context set to a different node than the XQuery expression evaluates to.
The modify method permits modifying parts of an XML instance.
You can create a primary XML index on an xml column.
The secondary PATH index is used for path-based queries.
The secondary PROPERTY index is used for property bag scenarios.
The secondary VALUE index is used for value-based queries.
XQuery provides the FLWOR expression syntax, which is an acronym for for-let-where-order-return and is pronounced flower.
You can still use the FOR XML clause to produce XML data, and FOR XML PATH lets you control the combination of XML data and non-XML data.
The ADO.NET SqlXml class lets you work with the SQL Server xml data type.
The SqlDataReader class contains a GetSqlXml method to retrieve XML data.
When you assign a schema to the SQL Server XML Schema Collection, the schema is parsed and stored. Non-schema data and annotations are not stored.