cross-browser XHR with XML and JSON support