hello
Freddie, you can use XPath. Maybe there are libraries, anyway is in J2SE 1.5:
javax.xml.xpath (Java 2 Platform SE 5.0)
If you have 1.4 version, you don´t find in libraries of java
I recommend this:
ONJava.com -- Parsing an XML Document with XPath
A tutorial of expressions XPath (XPath is independent of Java):
XPath Tutorial
more information about XPath and Java, when JDK 1.5 doesn´t exist:
Effective XML processing with DOM and XPath in Java
In this times, they use Xalan as library of XPath, and it needs Xerces libraries
Xalan-Java Version 2.7.0
good luck