File f = new File("C:\\d.xml");
FileWriter writer;
try {
writer = new FileWriter(f);
XMLOutputter outputter = new XMLOutputter();
// outputter.setEncoding("gb2312");
outputter.output(resDoc, writer);
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}