<function>xmlroot</function>(<replaceable>xml</replaceable>, version <replaceable>text</replaceable> <optional>, standalone yes|no|no value</optional>)
<function>xmlroot</function>(<replaceable>xml</replaceable>, version <replaceable>text</replaceable>|no value <optional>, standalone yes|no|no value</optional>)
</synopsis>
</synopsis>
<para>
<para>
Creates the root node of an XML document.
The <function>xmlroot</function> expression alters the properties
of the root node of an XML value. If a version is specified,
this replaces the value in the version declaration, if a
standalone value is specified, this replaces the value in the
standalone declaration.
</para>
<para>
<screen><![CDATA[
SELECT xmlroot(xmlparse(document '<?xml version="1.1"?><content>abc</content>'), version '1.0', standalone yes);
xmlroot
----------------------------------------
<?xml version="1.0" standalone="yes"?>
<content>abc</content>
]]></screen>
</para>
</sect3>
<sect3>
<title>XML Predicates</title>
<indexterm>
<primary>IS DOCUMENT</primary>
</indexterm>
<synopsis>
<replaceable>xml</replaceable> IS DOCUMENT
</synopsis>
<para>
The expression <literal>IS DOCUMENT</literal> returns true if the
argument XML value is a proper XML document, false if it is not
(that is, it is a content fragment), or null if the argument is
null. See <xref linkend="datatype-xml"> about the difference
between documents and content fragments.
</para>
</para>
</sect3>
</sect2>
<sect2>
<title>Processing XML</title>
<para>
<acronym>XML</> support is not just the existence of an
<type>xml</type> data type, but a variety of features supported by
a database system. These capabilities include import/export,
indexing, searching, transforming, and <acronym>XML</> to
<acronym>SQL</> mapping. <productname>PostgreSQL</> supports some
but not all of these <acronym>XML</> capabilities. For an
overview of <acronym>XML</> use in databases, see <ulink