(I experimented with v8.3.7, v8.4.4 and v9.0.0 on Windows XP)
It includes an xml declaration if the parameter is standalone xmlrootused with a value of yesor no:
SELECT xmlserialize (DOCUMENT (
SELECT xmlroot(
xmlelement(name root,
xmlelement(name value, 'test')
), version '1.0', standalone yes)
) AS text);
source
share