final DocumentImpl doc = source.getDocument(broker, resourcePath.lastSegment());
if(doc == null) {
transact.abort(transaction);
throw new XMLDBException(ErrorCodes.NO_SUCH_RESOURCE, "Resource " + resourcePath + " not found");
}
destination = broker.openCollection(destinationPath, Lock.WRITE_LOCK);
if(destination == null) {
transact.abort(transaction);
throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + destinationPath + " not found");
}
if (newName == null)