xpath = xp;
System.out.println("XPath = " + xpath);
System.out.println("Sort-by = " + sortBy);
}
final XPathQueryServiceImpl service = (XPathQueryServiceImpl) current.getService("XPathQueryService", "1.0");
service.setProperty(OutputKeys.INDENT, properties.getProperty("indent"));
service.setProperty(OutputKeys.ENCODING, properties.getProperty("encoding"));
for(final Map.Entry<String, String> mapping : namespaceMappings.entrySet()) {
service.setNamespace(mapping.getKey(), mapping.getValue());
}
return (sortBy == null) ? service.query(xpath) : service.query(xpath, sortBy);
}