JDOM parsing

hi,

TXQuery query = TXQuery.newInstance("for $a in input()/user_detail/user "
+ “where $a/@user_id = '” + userNameTmp + "’ "
+ “and $a/@password = '” + tmpPassWord + "’ "
+ “return $a”);
System.out.println("Query: " + query);

        TResponse response = accessor.xquery(query);

i want to parse this query result through jdom which is in the form of TResponse, plz can anybody suggest me what i have to do next.

Assuming you have created an Accessor like this:


TXMLObjectAccessor myAccessor = myConnection.newXMLObjectAccessor(TAccessLocation.newInstance( DB_COLLECTION ) ,
TJDOMObjectModel.getInstance() );

the API TResponse will contain JDOM instances, so you just need code like this to step through the root "org.jdom.Element"s:


if (response.getReturnValue().equals("0")) {
    TXMLObjectIterator it = response.getXMLObjectIterator();
    while (it.hasNext()) { 
        TXMLObject myObject = it.next();
        System.out.println("Getting Root Element");
        Element myRootElement = (Element) myObject.getElement();
        System.out.println(myRootElement);	
     }
}