lib/index.js
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 + ' })';
}
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 + ' })';
}
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 + ' })' ; }
Parse the given `str` of XML builder and return a function body.

@param {String} str
@param {Object} options
@return {String}
@api private
Parse the given str of XML builder and return a function body .