FOR XML SQL Clause tutorial
General FOR XML SQL Clause

## For XML SQL Clause Overview

This feature enables the execution SQL queries against the Virtuoso Server 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 in the FOR XML clause, specify one of these XML modes:

- RAW - transforms each row in the query result set into an XML element with the generic identifier row.
- AUTO - returns query results as nested XML elements.
- EXPLICIT - authors of query can control the structure of the XML document returned by the query.

## Examples

This example shows a simple use of the For XML SQL 'Auto' statement for executing a query and returning the results in XML format.