Retrieving XML Documents Using FOR XML
New Information - SQL Server 2000 SP3.
You can execute SQL queries against existing relational databases to return results as XML documents rather than as standard rowsets. To retrieve results directly, use the FOR XML clause of the SELECT statement, and within the FOR XML clause, specify one of these XML modes:
These modes are in effect only for the execution of the query for which they are set. They do not affect the results of any subsequent queries. In addition to specifying the XML mode, you can also request the XML-Data schema.
Security Note Support for this XML functionality has been enhanced in the Web releases of Microsoft® SQLXML. For the latest enhancements, install Microsoft SQLXML 3.0 Service Pack 1 from this Microsoft Web site. The documentation that accompanies this service pack provides security considerations for developing applications.