The following bug has been logged on the website:
Bug reference: 13810
Logged by: Filip Jirsák
Email address: filip@jirsak.org
PostgreSQL version: 9.4.5
Operating system: x86_64-pc-linux-gnu
Description:
CREATE FUNCTION test_cursor_to_xml() RETURNS xml AS $$
DECLARE
curs CURSOR FOR SELECT generate_series(1, 5);
BEGIN
OPEN curs;
RETURN cursor_to_xml(curs, 10, TRUE, FALSE, '');
END;
$$ LANGUAGE plpgsql;
SELECT test_cursor_to_xml();
This returns XML forrest instead of XML document with single root.