code: def query(wosclient, wos_query, xml_query=None, count=5, offset=1, limit=100):
      
      results = [single(wosclient, wos_query, xml_query, min(limit, count-x+1), x)
                 for x in range(offset, count+1, limit)]
      if xml_query:
          return [el for res in results for el in res]
      else:
          pattern = _re.compile(r'^<\?xml.*?\n<records>\n|\n</records>$.*')
          return ('<?xml version="1.0" ?>\n<records>' +
                  '\n'.join(pattern.sub('', res) for res in results) +
                  '</records>')
docs: Query Web of Science and XML query results with multiple requests.