} else if ("update".equals(operation)) {
try {
XUpdateQueryService service =
(XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
long count = (this.key == null)?
service.update(document) : service.updateResource(this.key, document);
message = count + " entries updated.";
result = "success";
} catch (XMLDBException e) {
message = "Failed to update resource " + key + ": " + e.errorCode;
getLogger().debug(message, e);