Ah oke i will use XQuery for now. I think its better solution for this project.
 
Another question ..
 
String str = "<CATALOG><CD><TITLE>Empire Burlesque</TITLE><ARTIST>Bob Dylan</ARTIST><COUNTRY>USA</COUNTRY><COMPANY>Columbia</COMPANY><PRICE>10.90</PRICE><YEAR>1985</YEAR></CD><CD><TITLE>Hide your heart</TITLE><ARTIST>Bonnie Tyler</ARTIST><COUNTRY>UK</COUNTRY><COMPANY>CBS Records</COMPANY><PRICE>9.90</PRICE><YEAR>1988</YEAR></CD></CATALOG>";
 
 
 How can i iterate through this xml string. I know the way when you use a located xml file but not the solution with a string. Do i need to use an bindObject or bindString to do that ?
 

expression.bindString(

new QName("v"), rt, conn.createAtomicType(XQItemType.XQBASETYPE_STRING));

String query2 =

"declare variable $v as xs:string external; for $cd in $v/CATALOG/CD return <title>{$cd/TITLE/text()}</title>)";

XQSequence results = expression.executeQuery(query2);

I appreciate your answers..