title: Parsing .gz sitemaps
body: <p>I am trying to parse the sitemap index that contains list of sitemaps.</p>
  
  <p>I successfuly parsed the sitemapindex.xml and have gotten the list of .gz links; but I am wondering what would be the best way of opening them as xml ?</p>
  
  <pre><code>        String sitemap = "http://www.site.com/siteindex.xml";
          XmlDocument xml = new XmlDocument();
          xml.Load(sitemap);
          XmlNamespaceManager manager = new XmlNamespaceManager(xml.NameTable);
          manager.AddNamespace("s", xml.DocumentElement.NamespaceURI); //Using xml's properties instead of hard-coded URI 
          XmlNodeList xnList = xml.SelectNodes("/s:sitemapindex/s:sitemap", manager);
  
          var parallelLoop1 = xnList.Count;
          Parallel.For(0, parallelLoop1, parOptions, index =&gt;
          {
              String NAME = xnList[index]["loc"].InnerText;
              System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(NAME);
              req.Timeout = 1000 * 60 * 60; // milliseconds 
              System.Net.WebResponse res = req.GetResponse();
              Stream responseStream = res.GetResponseStream();
              XmlDocument xml2 = new XmlDocument();
              xml2.Load(responseStream); //this is the part where it fails- file is .gz, but xml expected
              responseStream.Close();
      ......... more code
          }
  </code></pre>