       null # xml:base if XML-based profile
 
     getLang: ->
-      @attrs.lang?.value
+      @attrs['xml:lang']?.value or @attrs.lang?.value
 
     getVocab: ->
       @attrs.vocab?.value
 
     getPrefixes: ->
+      prefixes = @getNamespaces()
       val = @attrs.prefix?.value
-      return null unless val
+      return prefixes unless val
       pfxs = val.replace(/^\s+|\s+$/g, "").split(/:?\s+/)
-      prefixes = {}
       for i in [0...pfxs.length] by 2
         pfx = pfxs[i]
         ns = pfxs[i+1]
         prefixes[pfx] = ns
+      prefixes
+
+    getNamespaces: ->
+      prefixes = {}
+      for attr in @attrs
+        if attr.name.match(/^xmlns:/)
+          prefixes[attr.name.substring(6)] = attr.value
       prefixes
 
     getAbout: ->

      unless lit.lang or lit.datatype
        lit.value
      else
        {"@value": lit.value, "@language": lit.lang, "@datatype": lit.datatype}

    getLinks: ->
      if @rels

      else
        present = !!(rels.length or revs.length)
        hanging = {present: present, rels: rels, revs: revs, inlist: inlist}

      value = desc.getLiteral()
      if value
