
function getElementsByXPath(xmlDoc, xpath){
	if (window.ActiveXObject) {
	    //IE
        return xmlDoc.getElementsByTagName(xpath);	    
    }else{
        return xmlDoc.evaluate(xpath, xmlDoc, NSResolver, XPathResult.ANY_TYPE,null);        
    }
}


function NSResolver(prefix) {
  if(prefix == 'html') {
    return 'http://www.w3.org/1999/xhtml';
  }
  else if(prefix == 'mathml') {
    return 'http://www.w3.org/1998/Math/MathML'
  }
  else  {
  //this shouldn't ever happen
    return null;
  }
}

