This is the XMLHttpRequest function I always use; see quirksmode.js, the script file that's used in every page on this site.
www.quirksmode.org