docs: function transfer(xmlFiles, output, dir, needAppend, _callback){
    /**
     * If needAppend is true, output must be a file but not a directory
     */
    Step(
      function(){
        if(typeof output === 'undefined'){
          output = path.dirname(xmlFiles[0]);
        }
        output = output.indexOf(path.sep) === 0 ? output : path.join(process.cwd(), output);
        fs.stat(output, this); 
      },
  
      function(err, stat){
        if(err){
          throw err;
        }
  
        if(needAppend){
          if(!stat.isFile()){
            throw new Error('Output must be a file but not a directory when --append is enabled');
          }
        }else{
          if(!stat.isDirectory()){
            throw new Error('Output must be a directory');
          }
          output = path.join(output, 'nproxy-rule.js');
        }
        
        return output;
      },
  
      function transferBatch(err, outputFile){
        var group;
  
        if(err){
          throw err;
        }
  
        group = this.group();
  
        xmlFiles.forEach(function(xmlFile){
          transferSingleFile(xmlFile, dir, group());
        });
      },
  
      function append(err, rules){
        var wrapperTpl;
        var result;
        var isTargetEmpty = true;
  
        if(err){
          throw err;
        }
  
        if(needAppend){
          wrapperTpl = fs.readFileSync(output, 'utf-8');
          isTargetEmpty = false;
        }else{
          wrapperTpl = [
            'module.exports = [/*{{more}}*/',
            '];'
          ].join(EOL);
        }
  
        return _append(wrapperTpl, rules, isTargetEmpty);
      },
  
      function writeOutput(err, content){
        if(err){
          throw err;
        }
  
        fs.writeFile(output, 
          content,
          'utf-8', function(err){
            if(err){ throw err};
            log.info('Write output file successfully!');
            if(typeof _callback === 'function'){
              _callback(null);
            }
        });
      }
    );
  
  }