起先是dbms_xmldom.setCharset(doc,'UTF8')不起作用,导出来的xml只有;在setversion中加入:dbms_xmldom.setversion(doc,'1.0"encoding="UTF-8');dbms_xmldom.writeToFile(doc,xmlfile,'UTF-8');