No problem at all doing that.
Most of modern browses even have a static instance of XmlHTTPRequest already present in the window object and is accessible through window.XMLHttpRequest
More information on that here:
http://msdn.microsoft.com/en-us/library/ms535157(VS.85).aspxSo you can check if this object exist and only create your own if it doesn't