XMLHttpRequest with cancel, timeout and retry option
First of all, there's already a fetch function that's already available in most modern browsers. If you care about IE, there's also a polyfill for it. With that out of the way, we can ignore the first part of your code and focus on the second part of the code.

While it's perfectly fine JS, having very long argument lists is horrible. As a developer, you have to evaluate which arguments take priority and come first. As a consumer, you have to remember which ones come first. I suggest turning your options into an object. You can use Object.assign to merge a defaults object.

With regards to your control flow, you can simplify the retry routine by simply calling fetchWithRetry recursively, passing it the retries remaining. Since this operates on just promises and promises cannot be cancelled, this version's abort bails out when abort is called during the delay or after the request, not immediately.

const fetchWithRetry = (userOptions) =&gt; {
  let abort = false;
  const options = {
    url: '',
    options: {},
    cancel: {},
    retries: 3,
    retryDelay: 1000,
    ...userOptions
  };

  // Add an abort to the cancel object.
  cancel.abort = () =&gt; { abort = true };

  // Abort or proceed?
  return abort ? Promise.reject('aborted') : fetch(options.url).then(response =&gt; {

      // Reject because of abort
    return abort ? Promise.reject('aborted')

      // Response is good 
      : response.ok ? Promise.resolve(response.text()) 

      // Retries exceeded
      : !options.retries ? Promise.reject('retries exceeded')

      // Retry with one less retry
      : new Promise((resolve, reject){
          setTimeout(() =&gt; {

            // We use the returned promise's resolve and reject as
            // callback so that the nested call propagates backwards.
            fetchWithRetry({ ...options, retries: retries - 1 }).then(resolve, reject);
          }, options.retryDelay);

        });
  });
}