Map.Entry mapping; for(Iterator i = namespaceMappings.entrySet().iterator(); i.hasNext(); ) { mapping = (Map.Entry)i.next(); service.setNamespace((String)mapping.getKey(), (String)mapping.getValue()); }
	private final ResourceSet find(String xpath) throws XMLDBException {		if (traceWriter != null)			try {				traceWriter.write("<query>");				traceWriter.write(xpath);				traceWriter.write("</query>\r\n");			} catch (IOException e) {			}		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");		service.setProperty("pretty", properties.getProperty("indent"));		service.setProperty("encoding", properties.getProperty("encoding"));		return (sortBy == null) ? service.query(xpath) : service.query(xpath, sortBy);	}