declare
c_x sys_refcursor;
l_xml_ xmltype;
begin
open c_x for select t.a,t.b,t.c
from zzz_test t;
select t.xml_
into l_xml_
from xmltable(‘/’
passing xmltype(c_x)
columns xml_ xmltype path ‘.’) t;
dbms_output.put_line(l_xml_.getclobval());
end;
<?xml version="1.0"?> <ROWSET> <ROW> <A>1</A> <B>Some text</B> <C>6</C> </ROW> <ROW> <A>7</A> <B>Some other text</B> <C>5</C> </ROW> <ROW> <A>8</A> <C>4</C> </ROW> </ROWSET>