docs: function library(module) {
    if (module == null) {
      throw new Error(
          'library must name the module that defines the apply functions'
          );
    }
  
    var rootname = mlutil.rootname(module);
    if (rootname === null) {
      throw new Error('library must have an extension of .xqy');
    }
  
    return {'replace-library':{
      ns:  'http://marklogic.com/patch/apply/'+rootname,
      at: '/ext/marklogic/patch/apply/'+module
    }};
  }