code: function parse(str, options) {
    var doc = options.document || 'xml'
      , pretty = options.pretty || false
      , js = str;
    
    return ''
      + 'var ' + doc + ' = factory();\n'
      + (options.self
        ? 'var self = locals || {};\n' + js
        : 'with (locals || {}) {\n' + js + '\n}\n')
      + 'return ' + doc + '.toString({ pretty: ' + pretty + ' })';
  }
docs: Parse the given `str` of XML builder and return a function body.
  
  @param {String} str
  @param {Object} options
  @return {String}
  @api private