def namespace(prefix=nil)
      if prefix.nil?
        prefix = prefix()
      end
      if prefix == ''
        prefix = "xmlns"
      else
        prefix = "xmlns:#{prefix}" unless prefix[0,5] == 'xmlns'
      end
      ns = attributes[ prefix ]
      ns = parent.namespace(prefix) if ns.nil? and parent
      ns = '' if ns.nil? and prefix == 'xmlns'
      return ns
    end
def namespace(prefix=nil)
      if prefix.nil?
        prefix = prefix()
      end
      if prefix == ''
        prefix = "xmlns"
      else
        prefix = "xmlns:#{prefix}" unless prefix[0,5] == 'xmlns'
      end
      ns = attributes[ prefix ]
      ns = parent.namespace(prefix) if ns.nil? and parent
      ns = '' if ns.nil? and prefix == 'xmlns'
      return ns
    end
Evalutas to the URI for a prefix, or the empty string if no such
 namespace is declared for this element. Evaluates recursively for
 ancestors.  Returns the default namespace, if there is one.
 prefix::
   the prefix to search for.  If not supplied, returns the default
   namespace if one exists
 Returns::
   the namespace URI as a String, or nil if no such namespace
   exists.  If the namespace is undefined, returns an empty string
  doc = Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
  b = doc.elements['//b']
  b.namespace           # -> '1'
  b.namespace("y")      # -> '2'