Hey, I want to get data out of a database into an xml file. This is what I do. Please help me where I go wrong.

File userFile = new File("users.xml");

// I create a root element
Element root = new Element("user");
// I add some content
root.addContent(" ");
// I create a document object and assing root as his root element
Document doc = new Document(root);

// I call a function I use to save the doc, using a outputStream

// I get my data into a resultset

// I browse true my resultset
while (result.nect()) {
THIS IS THE PROBLEM: how do I create nodes to the root element and assign the data from the resultset to this node???

// call the function to save the doc again.

Let's say the data from the resultset is a number of persons with a name and an age, so I would like to have somehting like this: