SQL Server 2008 supports XML generation from relational data via the
FOR XML clause of the
SELECT statement. The
FOR XML clause is a flexible and versatile way to quickly and easily construct XML from your relational data. SQL Server 2008 continues the tradition of
FOR XML clause support, including the following enhancements to the
FOR XML clause:
The addition of
PATH mode simplifies, and adds flexibility to, the process of specifying an explicit structure for your XML data.
ABSENT modifiers for the
ELEMENTS option provide fine-grained control over SQL
NULL representation in your XML result.
TYPE option for converting your result XML to the
xml data type.
Support is included for nested ...