But now it looks like that there are standard ways to do it (see AJAX, ARSCIF, and JSON links below).
I didn't want to mess with XML format and used XMLHttpRequest.responseText, although there is XMLHttpRequest.responseXML property. Michal Migurski says here http://mike.teczno.com/json.html that, "In experimenting with XMLHTTPRequest, I've found that using a less-bloaty data exchange format beats XML."
Another important difference is that my function uses a synchronous mode of XMLHTTP and returns a value, while the following libraries are oriented on asynchronous calls and use callback techniques. I don't know what is better approach when using XMLHTTP; perhabs it depend on application requirement.
Below is a set of related links.