DOM - Creating Documents

Jeff Greif jmg at
Thu Apr 22 18:12:07 BST 1999

Snarfed from the very useful guide.html that came with the IBM xml4j
(version 1.1.9) distribution
(the documentation has changed in later versions, and I haven't looked for
the replacement.):

Creating a new XML document is a three step process. First, create the
TXDocument, which is the concrete implementation of Document. Second, create
the various XML objects using the TXDocument's create* methods. Finally, use
appendChild to append these appropriately to the TXDocument or sub-Elements.
Make a TXDocument instance.

TXDocument doc = new TXDocument();

 Create something, a DTD or root Element.
        Element root = doc.createElement("ROOT"));

Append  the newly created Element.

Append something to the root Element you have added.


----- Original Message -----
From: Ronald Bourret <rbourret at>
To: 'XML-DEV' <xml-dev at>
Sent: Thursday, April 22, 1999 4:55 AM
Subject: Re: DOM - Creating Documents

> 2) Is it really not possible to create a new Document with IBM's classes?
>  I can't find a method for doing it.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list