DefaultHandler handler = new DefaultHandler(); for (int i = 0; i < result.getSize(); i++) { XMLResource next = (XMLResource) result.getResource((long)i); next.getContentAsSAX(handler); } service.endProtected();
	public boolean execute() throws Exception {	    long start = System.currentTimeMillis();	    		Collection col = DatabaseManager.getCollection(collectionPath);				System.out.println(Thread.currentThread().getName() + ": executing query: " + xquery);				XPathQueryServiceImpl service = (XPathQueryServiceImpl)			col.getService("XPathQueryService", "1.0");		//		service.beginProtected();		ResourceSet result = service.query(xquery);		System.out.println(Thread.currentThread().getName() + ": found " + result.getSize());		//		DefaultHandler handler = new DefaultHandler();//		for (int i = 0; i < result.getSize(); i++) {//			XMLResource next = (XMLResource) result.getResource((long)i);//			next.getContentAsSAX(handler);//		}//		service.endProtected();				runningTime += (System.currentTimeMillis() - start);		called++;				System.out.println(Thread.currentThread().getName() + ": XQuery completed.");		return false;	}