Revise loadWithXHR with req.responseType = 'document'