I am trying to download an Excel file using Ajax (XMLHttpRequest).
On completion the responseText is found to have just 5 characters.
The network sniffing tool
The issue is probably that XMLHttpRequest doesn't ususally take binary data like an Excel file. If you just want to let the user download the file, read Ramiz's post. If you need to read the data in JavaScript, try switching to a text format like CSV (or better for parsing, JSON). If you really need to read a binary file, there are discussions of that here and here.
Do not use Ajax call (xmlhttprequest) to download/upload files. Better do it on server side.