参考:http://stackoverflow.com/questions/15209245/adding-content-to-existing-xml-with-jdom
代码如下:
Element child = new Element("product");
child.addContent(new Element(categorieelement).setText(product.categorie));
child.addContent(new Element("code").setText(product.code));
child.addContent(new Element(naamelement).setText(product.naamartikel));
child.addContent(new Element(descriptionelement).setText(product.beschrijvingartikel));
child.addContent(new Element("price").setText(prijs));
child.addContent(new Element("image").setText(product.imgurl));