Slightly simplify $.ajax.
Use xhr.responseType = 'document'.