code: function(data) {
          if(typeof data == "string") {
              data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
          }
          var raw = data;
          if(data && data.nodeType == 9) {
              data = data.documentElement;
          }
          var capabilities = {};
          this.readNode(data, capabilities);
          if (capabilities.service === undefined) {
              // an exception must have occurred, so parse it
              var parser = new OpenLayers.Format.OGCExceptionReport();
              capabilities.error = parser.read(raw);
          }
          return capabilities;
      }
docs: Constructor: OpenLayers.Format.WMSCapabilities.v1
  Create an instance of one of the subclasses.
  
  Parameters:
  options - {Object} An optional object whose properties will be set on
  this instance.
   
  APIMethod: read
  Read capabilities data from a string, and return a list of layers.
  
  Parameters:
  data - {String} or {DOMElement} data to read/parse.
  
  Returns:
  {Array} List of named layers.