XMLSerialize() function

The XMLSerialize() function converts a value of type XML to a value of type varchar or nvarchar. The inverse function is XMLParse().

Syntax

The XMLSerialize() function has the following syntax:
varchar = XMLSerialize(XML input);
nvarchar = XMLSerialize(XML input);

The input value specifies a value of type XML, which is the Netezza Performance Server compiled representation of an XML file.

Returns

The function returns the varchar or nvarchar representation of the input XML object.

Examples

Consider the following example:
select XMLSerialize(XMLElement('Parent', 'Parent Text'));
        XMLSERIALIZE
------------------------------
 <Parent>Parent Text</Parent>
(1 row)
Without the XMLSerialize() function call, the XMLElement() function call returns the XML type:
 XMLELEMENT
-----------
 XML
(1 row)