def fetch_xml(issn)

      xml =
        begin
          url = request_url(issn)
          response = http_client.get(url)

          # In some cases, status 401 seems to be bad email
          unless response.ok?
            # trim some XML boilerplate and remove newlines
            # from response body, for better error message
            response_body = response.body.gsub(/[\n\t]/, '').sub(/\A<\?xml[^>]*\>/, '')

            raise FetchError.new("#{url}: returns #{response.status} response: #{response_body}")
          end

          Nokogiri::XML(response.body)
        rescue SocketError => e
          raise FetchError.new("#{url}: #{e.inspect}")
        end

      # There's no good way to tell we got an error from unregistered email
      # or other usage problem except sniffing the XML to try and notice
      # it's giving us a usage message.
      if ( xml.xpath("./rdf:RDF/rss:item", xml_ns).length == 1 &&
           xml.at_xpath("./rdf:RDF/rss:item/rss:link", xml_ns).try(:text) == "http://www.journaltocs.ac.uk/develop.php" )
        raise FetchError.new("Usage error on api call, missing registered email? #{request_url}")
      end

      return xml
    end
def fetch_xml(issn)

      xml =
        begin
          url = request_url(issn)
          response = http_client.get(url)

          # In some cases, status 401 seems to be bad email
          unless response.ok?
            # trim some XML boilerplate and remove newlines
            # from response body, for better error message
            response_body = response.body.gsub(/[\n\t]/, '').sub(/\A<\?xml[^>]*\>/, '')

            raise FetchError.new("#{url}: returns #{response.status} response: #{response_body}")
          end

          Nokogiri::XML(response.body)
        rescue SocketError => e
          raise FetchError.new("#{url}: #{e.inspect}")
        end

      # There's no good way to tell we got an error from unregistered email
      # or other usage problem except sniffing the XML to try and notice
      # it's giving us a usage message.
      if ( xml.xpath("./rdf:RDF/rss:item", xml_ns).length == 1 &&
           xml.at_xpath("./rdf:RDF/rss:item/rss:link", xml_ns).try(:text) == "http://www.journaltocs.ac.uk/develop.php" )
        raise FetchError.new("Usage error on api call, missing registered email? #{request_url}")
      end

      return xml
    end
strip_tags
 return a nokogiri document of journal Tocs results. Usually just for internal use, use
 #fetch_by_issn instead.

 May raise JournalTocsFetcher::FetchError on error (bad baseURL, bad API key,
 error response from journaltocs)