You can select all the elements you want in XPath, but there's no direct way of serializing them into the XML you need to construct in your StringBuffer. The job is much easier in XSLT or XQuery - and it's just as easy to call XSLT or XQuery from Java as to call XPath.
Michael Kay

From: Erik Rens []
Sent: 31 March 2009 07:53
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Fwd: Xpath 2.0 sequences and Saxon examples problems.

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.