private boolean isValid(XmldbURI docUri) throws EXistException, PermissionDeniedException {
boolean isValid=false;
try {
// Setup validator
final Validator validator = new Validator(factory.getBrokerPool());
// Get inputstream
// TODO DWES reconsider
final InputStream is = new EmbeddedInputStream( new XmldbURL(docUri) );
// Perform validation
final ValidationReport report = validator.validate(is);
// Return validation result
isValid = report.isValid();
} catch (final Throwable e) {