XML and Internet Support

Guidelines for Using the FOR XML Clause

The FOR XML clause is valid only in the SELECT statement and is subject to these limitations:

In addition, SQL Server names containing characters that are invalid in XML names (such as spaces) are translated into XML names in a way in which the invalid characters are translated into escaped numeric entity encoding.

There are only two nonalphabetic characters that can begin an XML name: the colon (:) and the underscore (_). Because the colon (:) is already reserved for namespaces, the underscore (_) is chosen as the escape character. The escape rules used for encoding are:

See Also

Executing SQL Statements Using HTTP

Executing Template Files Using HTTP

SELECT