docs: function(data) {
          if(typeof data == "string") { 
              var newData = new OpenLayers.Format.XML();
              data = newData.read(data);
          }
          var response = new OpenLayers.Format.ArcXML.Response();
          
          var errorNode = data.getElementsByTagName("ERROR");
          
          if (errorNode != null && errorNode.length > 0) {
              response.error = this.getChildValue(errorNode, "Unknown error.");
          } else {
              var responseNode = data.getElementsByTagName("RESPONSE");
            
              if (responseNode == null || responseNode.length == 0) {
                  response.error = "No RESPONSE tag found in ArcXML response.";
                  return response;
              }
            
              var rtype = responseNode[0].firstChild.nodeName;
              if (rtype == "#text") {
                  rtype = responseNode[0].firstChild.nextSibling.nodeName;
              }
            
              if (rtype == "IMAGE") {
                  var envelopeNode = data.getElementsByTagName("ENVELOPE");
                  var outputNode = data.getElementsByTagName("OUTPUT");
                  
                  if (envelopeNode == null || envelopeNode.length == 0) {
                      response.error = "No ENVELOPE tag found in ArcXML response.";
                  } else if (outputNode == null || outputNode.length == 0) {
                      response.error = "No OUTPUT tag found in ArcXML response.";
                  } else {
                      var envAttr = this.parseAttributes(envelopeNode[0]);            
                      var outputAttr = this.parseAttributes(outputNode[0]);
                    
                      if (typeof outputAttr.type == "string") {
                          response.image = { 
                              envelope: envAttr, 
                              output: { 
                                  type: outputAttr.type, 
                                  data: this.getChildValue(outputNode[0])
                              }
                          };
                      } else {
                          response.image = { envelope: envAttr, output: outputAttr };
                      }
                  }
              } else if (rtype == "FEATURES") {
                  var features = responseNode[0].getElementsByTagName("FEATURES");
              
                  // get the feature count
                  var featureCount = features[0].getElementsByTagName("FEATURECOUNT");
                  response.features.featurecount = featureCount[0].getAttribute("count");
              
                  if (response.features.featurecount > 0) {
                      // get the feature envelope
                      var envelope = features[0].getElementsByTagName("ENVELOPE");
                      response.features.envelope = this.parseAttributes(envelope[0], typeof(0));
  
                      // get the field values per feature
                      var featureList = features[0].getElementsByTagName("FEATURE");
                      for (var fn = 0; fn < featureList.length; fn++) {
                          var feature = new OpenLayers.Feature.Vector();
                          var fields = featureList[fn].getElementsByTagName("FIELD");
  
                          for (var fdn = 0; fdn < fields.length; fdn++) {
                              var fieldName = fields[fdn].getAttribute("name");
                              var fieldValue = fields[fdn].getAttribute("value");
                              feature.attributes[ fieldName ] = fieldValue;
                          }
  
                          var geom = featureList[fn].getElementsByTagName("POLYGON");
  
                          if (geom.length > 0) {
                              // if there is a polygon, create an openlayers polygon, and assign
                              // it to the .geometry property of the feature
                              var ring = geom[0].getElementsByTagName("RING");
  
                              var polys = [];
                              for (var rn = 0; rn < ring.length; rn++) {
                                  var linearRings = [];
                                  linearRings.push(this.parsePointGeometry(ring[rn]));
  
                                  var holes = ring[rn].getElementsByTagName("HOLE");
                                  for (var hn = 0; hn < holes.length; hn++) {
                                      linearRings.push(this.parsePointGeometry(holes[hn]));
                                  }
                                  holes = null;
                                  polys.push(new OpenLayers.Geometry.Polygon(linearRings));
                                  linearRings = null;
                              }
                              ring = null;
                            
                              if (polys.length == 1) {
                                  feature.geometry = polys[0];
                              } else
                              {
                                  feature.geometry = new OpenLayers.Geometry.MultiPolygon(polys);
                              }
                          }
  
                          response.features.feature.push(feature);
                      }
                  }
              } else {
                  response.error = "Unidentified response type.";
              }
          }
          return response;
      }