Trying to get data stream from one class to another

I have a class to deserialize data into a stream, here is the method (using SimpleXML btw):

Then I have another class that takes an input stream, and uses it to generate a richfaces tree. I doubt the data stream I get from readXML will yield the correct results, but I have no other clue about what to try, so I at least want to give this a chance. Here is a snippet of that code:

This is sample code I got from a site that takes a data stream that comes froma .properties file to generate the tree nodes. I am just trying to substitute the data stream from readXML for the data stream that is currently coming from the .properties file.

So how can I take the data stream from the readXML class and substitute it into the second bit of code in place of the dataStream variable. Like I said, I doubt this will even compile, but I need some kind of starting point.

Or, if someone can help me write some code that takes elements from the follwoing layout and uses them to populate the tree nodes it would be great.

The tree nodes need to popuate from the <name>, <device>, and <channel> elements. In fact I think I will create a second post just for that in hopes I can get help with it.