docs: function(data) {
          if(typeof data == "string") {
              data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
          }
          var root = data.documentElement;
          var children = root.childNodes; 
          var describelayer = {layerDescriptions: []};
          var childNode, nodeName;
          for(var i=0; i<children.length; ++i) { 
              childNode = children[i];
              nodeName = childNode.nodeName; 
              if (nodeName == 'LayerDescription') {
                  var layerName = childNode.getAttribute('name');
                  var owsType = '';
                  var owsURL = '';
                  var typeName = '';
                  // check for owsType and owsURL attributes
                  if (childNode.getAttribute('owsType')) {
                    owsType = childNode.getAttribute('owsType');
                    owsURL = childNode.getAttribute('owsURL');
                  } else {
                      // look for wfs or wcs attribute
                      if (childNode.getAttribute('wfs') != '') {
                          owsType = 'WFS';
                          owsURL = childNode.getAttribute('wfs');
                      } else if (childNode.getAttribute('wcs') != '') {
                          owsType = 'WCS';
                          owsURL = childNode.getAttribute('wcs');
                      }
                  }
                  // look for Query child
                  var query = childNode.getElementsByTagName('Query');
                  if(query.length > 0) {
                      typeName = query[0].getAttribute('typeName');
                      if (!typeName) {
                          // because of Ionic bug
                          typeName = query[0].getAttribute('typename');
                      }
                  }
                  var layerDescription = {
                      layerName: layerName, owsType: owsType, 
                      owsURL: owsURL, typeName: typeName
                  };
                  describelayer.layerDescriptions.push(layerDescription);
                  
                  //TODO do this in deprecated.js instead:
                  // array style index for backwards compatibility
                  describelayer.length = describelayer.layerDescriptions.length;
                  describelayer[describelayer.length - 1] = layerDescription; 
                  
              } else if (nodeName == 'ServiceException') {
                  // an exception must have occurred, so parse it
                  var parser = new OpenLayers.Format.OGCExceptionReport();
                  return {
                      error: parser.read(data)
                  };
              }
          }
          return describelayer;
      }