Use feature detection instead of browser detection.
Use ActiveXObject on IEs, because DOMParser has no support for XPath.