code: function (statements, global) {
              var source = [];
              if (!global) {
                  source.push('function(scopes) {');
              }
              source.push('var buffer = ""' + (global ? ',' : ';'));
              if (global) {
                  source.push('config = this.config,' +
                      // current xtemplate engine
                      'engine = this, ' +
                      'utils = config.utils;');
  
                  var natives = '',
                      c,
                      utils = XTemplateRuntime.utils;
  
                  for (c in utils) {
                      natives += c + 'Util = utils["' + c + '"],';
                  }
  
                  if (natives) {
                      source.push('var ' + natives.slice(0, natives.length - 1) + ';');
                  }
              }
              if (statements) {
                  for (var i = 0, len = statements.length; i < len; i++) {
                      pushToArray(source, this[statements[i].type](statements[i]));
                  }
              }
              source.push('return buffer;');
              if (!global) {
                  source.push('}');
                  return source;
              } else {
                  return {
                      params: ['scopes', 'S', 'undefined'],
                      source: source
                  };
              }
          }
docs: ------------ helper generation function start