// Based on Apple's XHR documentation:
// http://developer.apple.com/internet/webcontent/xmlhttpreq.html
// in the example files;
//
// Function retrieves elements from an XML document element, including
// elements using namespaces.
 function getElementsByTagNameNS(prefix, local, parentElem) {
    var isNav = (navigator.appName=="Netscape"); 
    var isIE = (navigator.appName.indexOf("Explorer")!=-1);
    if ( ( isNav || isIE ) && parseFloat(navigator.appVersion)>=4 );
    var result = "";
    if (prefix && isIE) {
    // IE/Windows way of handling namespaces
    result = parentElem.getElementsByTagName(prefix + ":" + local);
    } else {
    // the namespace versions of this method 
    // (getElementsByTagNameNS()) operate
    // differently in Safari and Mozilla, but both
    // return value with just local name, provided 
    // there aren't conflicts with non-namespace element
    // names
    result = parentElem.getElementsByTagName(local);
    }

    return result;
}
