XPathQueryService service = (XPathQueryService) current.getService("XPathQueryService", "1.0");
String sortBy = null; int p = xpath.indexOf(" sort by "); if(p > -1) { String xp = xpath.substring(0, p); sortBy = xpath.substring(p + " sort by ".length()); xpath = xp; System.out.println("XPath =   " + xpath); System.out.println("Sort-by = " + sortBy); } XPathQueryServiceImpl service = (XPathQueryServiceImpl) current.getService("XPathQueryService", "1.0");
	private final ResourceSet find(String xpath) throws XMLDBException {		XPathQueryService service =			(XPathQueryService) current.getService("XPathQueryService", "1.0");		service.setProperty("pretty", properties.getProperty("indent"));		service.setProperty("encoding", properties.getProperty("encoding"));		return service.query(xpath);	}