Getting all the nodes

I am trying to get all the nodes from under an W3C XML document in a nodelist etc.

the xml doc may have multiple childNodes with each of those nodes having multiple childnodes themselfs and so on. How would i get all these nodes in a node list or at least multiple nodelists.

Please help

this is the derection i am going but this gets messy as i dont know how many child nodes have children of there own.

NodeList nlChildNodes = dDocument.getDocumentElement().getChildNodes();

for(int i=0; i<nlChildNodes.getLength(); i++)

{

sNodeName = nlChildNodes.item(i).getFirstChild().getNodeName();

if (nlChildNodes.item(i).hasChildNodes())

{

NodeList nlMoreChildNodes = nlChildNodes.item(i).getChildNodes();

//this gets messy as i dont know how many child nodes have children of there own.

}

}

>

[888 byte] By [rockinupthebigstuff] at [2007-9-30 22:29:56]
# 1
Sorted dont worry about it
rockinupthebigstuff at 2007-7-7 12:53:16 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...