<!--
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2018 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<refentry id="XS-F-1">
  <refmeta>
    <refentrytitle>FOR XML SQL Clause</refentrytitle>
    <refmiscinfo>tutorial</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>General</refname>
    <refpurpose>FOR XML SQL Clause</refpurpose>
  </refnamediv>

<refsect1 id="XS-F-1a">
<title>For XML SQL Clause Overview</title>

<para>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:</para> 
<itemizedlist mark="bullet">
   <listitem>RAW - transforms each row in the query result set into an XML element with the generic identifier row. </listitem> 
   <listitem>AUTO - returns query results as nested XML elements.</listitem> 
   <listitem>EXPLICIT - authors of query can control the structure of the XML document returned by the query. </listitem>
</itemizedlist> 
</refsect1>

<refsect1 id="XS-F-1b">
<title>Examples</title>

<para>This example shows a simple use of the For XML SQL 'Auto' statement for executing a query and returning 
the results in XML format.</para>
</refsect1>
</refentry>
