Hi Gustaf,
These are the same big questions that I dealt with when I was looking into xmlhttpd about 1 year ago when it started gaining momentum. But then things got busy and I was unable to pursue it.
It's a good thing too because between then and now a plethora of javascript libraries and ajax toolkits have been released that address those same questions.
I've just committed to OpenACS CVS Head the Ajax Helper package. Instead of re-inventing the wheel I decided to re-use what is available by utilizing Scriptaculous and the prototype javascript library.
http://cvs.openacs.org/cvs/openacs-4/packages/ajaxhelper/
A demo site will follow very soon.
Cheers,
Hamilton