Easy function for working with XMLHttpRequest.