转换 xml 格式,墨认识 utf-8 , 要输出成 gbk ,并保存
XMLOutputter so=new XMLOutputter();
Format format=Format.getPrettyFormat(); //格式化文档
format.setEncoding("GBK"); //由于默认的编码是utf-8,中文将显示为乱码,所以设为gbk
so.setFormat(format);
FileOutputStream fos = new FileOutputStream("laochai.xml");
so.output(Doc,fos);