SAXReader saxReader = new SAXReader();
Document document = saxReader.read(new File("d:/text.xml"));
Element root = document.getRootElement();
List list = root.content();
Element e = DocumentHelper.createElement("test");
list.add(0, e);
FileWriter fw = new FileWriter(new File("d:/text.xml"));
XMLWriter output = new XMLWriter(fw);
output.write(document);
output.close();