code: function(response, options) {
          if(options.callback) {
              var request = response.priv;
  
              // ensure that we have an xml doc
              var data = request.responseXML;
              if(!data || !data.documentElement) {
                  data = request.responseText;
              }
              
              var obj = this.format.read(data) || {};
              
              response.insertIds = obj.insertIds || [];
              if (obj.success) {
                  response.code = OpenLayers.Protocol.Response.SUCCESS;
              } else {
                  response.code = OpenLayers.Protocol.Response.FAILURE;
                  response.error = obj;
              }
              options.callback.call(options.scope, response);
          }
      }
docs: Method: handleCommit
  Called when the commit request returns.
  
  Parameters:
  response - {<OpenLayers.Protocol.Response>} The response object to pass
  to the user callback.
  options - {Object} The user options passed to the commit call.