create table t_xml(emp_content xmltype);
insert into t_xml
select xmltype(dbms_xmlquery.getxml('select * from emp')) from dual;
create or replace directory dir_xml as 'C:\';
create or replace procedure proc_export_xml
as
doc xmldom.DOMDocument;
v_path varchar2(100);
x_content xmltype;
begin
select emp_content into x_content from t_xml where rownum = 1;
doc := dbms_xmldom.newDOMDocument(x_content);
v_path := 'DIR_XML/emp.xml';
xmldom.writeToFile(doc, v_path);
end;