使用DOM,  DocumentBuilderFactory创建一个DocumentBuilder,然后使用DocumentBuilder分析这个文件(parse)生成一个Document, 然后用Document的createElement加上你的Node.