Sorry post some wrong code. This is better but still not working.
 

String query2 =

"for $cd in /CATALOG/CD" +

" return $cd/TITLE/text()";

XQSequence results = expression.executeQuery(query2);

When i run it , error:

XPDY0002: Finding root of tree: the context item is undefined

javax.xml.xquery.XQException

: Finding root of tree: the context item is undefined
 
2009/3/31 Erik Rens <mail2rens@gmail.com>
I know that you cant create new elements with XPath, but I can select and compare elements and put my new elements in a Stringbuffer (Java) and then print it to my screen am I right ?
 
But an other meaby better solution is XQuery or XSLT?!. Can I do this also in Java ?
 
I have to use Java not only XML documents to do ths Job.
 
Thank you for quick replying.