docs: function(node, prefix) {
          var uri = null;
          if(node) {
              if(node.lookupNamespaceURI) {
                  uri = node.lookupNamespaceURI(prefix);
              } else {
                  outer: switch(node.nodeType) {
                      case 1: // ELEMENT_NODE
                          if(node.namespaceURI !== null && node.prefix === prefix) {
                              uri = node.namespaceURI;
                              break outer;
                          }
                          var len = node.attributes.length;
                          if(len) {
                              var attr;
                              for(var i=0; i<len; ++i) {
                                  attr = node.attributes[i];
                                  if(attr.prefix === "xmlns" && attr.name === "xmlns:" + prefix) {
                                      uri = attr.value || null;
                                      break outer;
                                  } else if(attr.name === "xmlns" && prefix === null) {
                                      uri = attr.value || null;
                                      break outer;
                                  }
                              }
                          }
                          uri = this.lookupNamespaceURI(node.parentNode, prefix);
                          break outer;
                      case 2: // ATTRIBUTE_NODE
                          uri = this.lookupNamespaceURI(node.ownerElement, prefix);
                          break outer;
                      case 9: // DOCUMENT_NODE
                          uri = this.lookupNamespaceURI(node.documentElement, prefix);
                          break outer;
                      case 6: // ENTITY_NODE
                      case 12: // NOTATION_NODE
                      case 10: // DOCUMENT_TYPE_NODE
                      case 11: // DOCUMENT_FRAGMENT_NODE
                          break outer;
                      default: 
                          // TEXT_NODE (3), CDATA_SECTION_NODE (4), ENTITY_REFERENCE_NODE (5),
                          // PROCESSING_INSTRUCTION_NODE (7), COMMENT_NODE (8)
                          uri =  this.lookupNamespaceURI(node.parentNode, prefix);
                          break outer;
                  }
              }
          }
          return uri;
      }