OutputFormat o=OutputFormat.createPrettyPrint();
o.setNewlines(true);
o.setIndent(true);
XMLWriter xw=null;
try {
xw=new XMLWriter(new FileOutputStream("E:\\test\\.metadata\\.plugins\\"
+ "org.eclipse.wst.server.core\\tmp1\\wtpwebapps\\bbs1\\xml\\shouchangs.xml"),o);
这是写入(修改)这个xml的代码 在servlet里面 写入的路径是eclipse部署项目的webapps文件夹里面
xmlhttp.open("GET","xml\\shouchangs.xml",true);
xmlhttp.send();
这是读取时的代码