output.addAttribute(new QName("collection", FileModule.NAMESPACE_URI), collectionPath);
output.addAttribute(new QName("dir", FileModule.NAMESPACE_URI), targetDir.getAbsolutePath());
saveCollection(XmldbURI.create(collectionPath), targetDir, startDate, output);
output.endElement();
output.endDocument();
} catch(PermissionDeniedException pde) {
throw new XPathException(this, pde);
} finally {
context.popDocumentContext();