The first argument, XML_element_name, is the name of the XML node. It can be escaped if it contains certain characters. For details, see Identifier Escaping.
•
The optional second argument, XML_namespace_declaration, is the XMLNAMESPACE function.
•
The optional third argument, XML_attributes, is the XMLATTRIBUTES function.
•
The optional fourth argument, XML_element_content, is the content of the XML node, which can be an XML, numeric, or character type.
•
If XML_element_content evaluates to a character literal, it is escaped. For details, see Text Escaping.
Example
SELECT XMLELEMENT (name Details, XMLATTRIBUTES (ProductID AS product),