Writing on a file stream element by element

NP <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi.

I have a document so:
mydoc = new Document();
a root element:
rootElement = new Element(....);
mydoc.setRootElement(rootElement);

Now i create a new element:
Element myel = new Element(.....);

addin' it to the root:
rootElement.addContent(myel);

Now i must add the new information (myel) on a file. The code that i 
wrote was:
XMLOutputter out = new XMLOutputter(....);
out.output(mydoc, new File(....));

But in this way, everytime, i write the whole document in the file 
(delete file and rewrite the updated document).
My problem, instead, is write the new element one by one, everytime that 
i create it.
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.