How to Convert a Table into XML Document
The easiest way to do this is:

select dbms_xmlgen.getxml( 'select * from dept') as xml 
from dual;


There are other way more complicated ways of achieving similar results, but the answer would be significantly longer!