code: 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
    }};
  }
docs: The specification for a library of replacement functions as returned by
  the {@link patchBuilder#library} function.
  @typedef {object} patchBuilder.LibraryParam
  @since 1.0
   
  Specifies a library supplying functions to apply to existing content
  to produce the replacement content as part of
  {@link patchBuilder#replace} or {@link patchBuilder#replaceInsert} operations.
  The library must be installed as /ext/marklogic/patch/apply/MODULE_NAME.xqy
  and must have the http://marklogic.com/patch/apply/MODULE_NAME namespace.
  @method
  @since 1.0
  @memberof patchBuilder#
  @param {string} moduleName - the name of the module with the functions
  @returns {patchBuilder.LibraryParam} the specification for applying a function