'Return the sitemap body contained in the given response,
or None if the response is not a sitemap.'

def _get_sitemap_body(self, response):

    if isinstance(response, XmlResponse):
        return response.body
    elif gzip_magic_number(response):
        return gunzip(response.body)
    elif (response.url.endswith('.xml') or response.url.endswith('.xml.gz')):
        return response.body
