In Java I am using DocumentBuilderFactory, DocumentBuilder, and Document to read an xml file. But now I want to make a method that returns an arraylist of all values which follow a given node sequence. To explain better I'll give an example: Say I have the following xml file:
<one>
<two>
<three>5</three>
<four>6</four>
</two>
<two>
<three>7</three>
<four>8</four>
</two>
</one>
And I use the method with a string parameter "one.two.three", now the return value should be an array containing the numbers 5 and 7.
How can I build this arraylist?