Hey everyone. I'm having a lot of trouble with this, and would really appreciate any help.


I need to find the parents in an XML file which contain a specific tag, and then need to parse the strings from those parents and their children into a Java object, list or array (could also use some advice on the best way to store that XML info as strings).

Java Code:
<task>
    <task id=483492>
    <project id=484383>
        <date>2003/23/03</date>
    <name> project name example </name>
</task>
<task>
    <task id=483492>
    <name> task name example </name>
</task>
<task>
    <task id=483492>
    <project id=484383>
        <date>2003/23/03</date>
    <name> project name example </name>
</task>
<task>
    <task id=483492>
    <project id=484383>
        <date>2003/23/03</date>
    <name> project name example </name>
</task>
<task>
    <task id=483492>
    <name> task name example </name>
</task>

If a <task> parent has a <project> child, I need to put the data from each of those <task>'s children into some kind of list/array/object. I've already parsed a lot of this file with DOM (this is only a segment). I'm thinking it would make most sense to continue parsing in DOM, though I'm open to all methods.



Thanks in advance everyone.