try {
XQueryService xqs = (XQueryService) testCollection.getService("XQueryService", "1.0");
Source query = new FileSource(new File(TEST_QUERY), "UTF-8", false);
for (File file : files) {
xqs.declareVariable("doc", file.getName());
ResourceSet result = xqs.execute(query);
XMLResource resource = (XMLResource) result.getResource(0);
System.out.println(resource.getContent());
Element root = (Element) resource.getContentAsDOM();
NodeList tests = root.getElementsByTagName("test");
for (int i = 0; i < tests.getLength(); i++) {