public function getNsCode($longNs, $rt = false)
 {
     // if namespace exists - just use its name
     // otherwise add it as nsatrribute to root and use its name
     if (!is_array($this->docNamespaces)) {
         $this->docNamespaces = array();
     }
     if (array_key_exists($longNs, $this->docNamespaces)) {
         return $this->docNamespaces[$longNs];
     } else {
         $this->docNamespaces[$longNs] = 'ns' . $this->lastNsKey;
         //$this->logger->debug($this->namespaces[$longNs]);
         if ($rt === false) {
             $nsAttr = $this->dom->createAttributeNS($longNs, $this->docNamespaces[$longNs] . ":definitions");
         }
         $this->lastNsKey++;
         return $this->docNamespaces[$longNs];
     }
 }