Try this, it should answer your question. SELECT DBMS_XMLGEN.getxml ( 'select cursor(select ''1'' "one", ''2'' "two", ''3'' "three" from dual union all select ''1'' "one", ''2'' "two", ''3'' "three" from dual ) "numbers" from dual') FROM DUAL; > > -- //www.freelists.org/webpage/oracle-l