OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("GBK");
output = new XMLWriter(new FileWriter(new File(filename)), format);
output.write(document);
2.先刪文件再創建
File file = new File("d://xxx.xml");
if(file.exists()){
file.delete();
}
CreatXml temp = new CreatXml();
temp.createXMLFile("d://xxx.xml")