There's an example here... http://dom4j.org/guide.html
in the 'Creating a new document' section that shows you how. The trick is to use the addElement() method on a Document or Element which returns the reference to the new element, so you can recursively keep adding new elements to make the XML you want. James ----- Original Message ----- From: "Frank Sharpless" <[EMAIL PROTECTED]> To: "Dom4j List (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, February 13, 2002 10:00 PM Subject: [dom4j-user] Adding multiple element > Hello All.. > > I am trying to figure out how to add multiple nodes to a single element (I > hope I said that right!). > > This is my XML file before: > > <PHIMPORT> > <IMPORTINFORMATION> > <DETAIL> > <FIELD1>TEST</FIELD1> > <FIELD2>TEST2</FIELD2> > </DETAIL> > </IMPORTINFORMATION> > </PHIMPORT> > > This is what I want the result to be: > > <PHIMPORT> > <IMPORTINFORMATION> > <DETAIL> > <FIELD1>TEST</FIELD1> > <FIELD2>TEST2</FIELD2> > </DETAIL> > <DETAIL> > <FIELD1>TEST</FIELD1> > <FIELD2>TEST2</FIELD2> > </DETAIL> > <DETAIL> > <FIELD1>TEST</FIELD1> > <FIELD2>TEST2</FIELD2> > </DETAIL> > .. > </IMPORTINFORMATION> > </PHIMPORT> > > Any thoughts????? > > Thanks, > > A. Frank Sharpless > Manager, Application Development > Paperhost.Com, Inc. > [EMAIL PROTECTED] > 770.998.9172.611 > > > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
