throw new XPathException(this, "Resource " + doc + " not found");
}
final String newName = args[2].itemAt(0).getStringValue();
final CollectionManagementServiceImpl service = (CollectionManagementServiceImpl)
collection.getService("CollectionManagementService", "1.0");
service.moveResource(doc, (XmldbURI) null,
XmldbURI.xmldbUriFor(newName));
} catch (final XMLDBException e) {
logger.error(e.getMessage());
throw new XPathException(this, "XMLDB exception caught: " + e.getMessage(), e);