def render_to(path, options={})
      overwrite = options[:overwrite] == true || true
      compress  = options[:gzip]      == true || false

      path = File.expand_path(path)
      path << ".gz" unless path =~ /\.gz\z/i if compress

      if File.exists?(path) && !overwrite
        raise RuntimeError, "File already exists and not overwritable!"
      end

      File.open(path, 'wb') do |f|
        unless compress
          f.write(self.render)
        else
          gz = Zlib::GzipWriter.new(f)
          gz.write(self.render)
          gz.close
        end
      end
    end
def render_to(path, options={})
      overwrite = options[:overwrite] == true || true
      compress  = options[:gzip]      == true || false

      path = File.expand_path(path)
      path << ".gz" unless path =~ /\.gz\z/i if compress

      if File.exists?(path) && !overwrite
        raise RuntimeError, "File already exists and not overwritable!"
      end

      File.open(path, 'wb') do |f|
        unless compress
          f.write(self.render)
        else
          gz = Zlib::GzipWriter.new(f)
          gz.write(self.render)
          gz.close
        end
      end
    end
Render XML sitemap into the file

 path    - Output filename
 options - Options hash

 options[:overwrite] - Overwrite the file contents (default: true)
 options[:gzip]      - Gzip file contents (default: false)