'Get the I{unique} set of namespaces referenced in the branch.
@return: A set of namespaces.
@rtype: set'

def getNamespaces(self):

    s = set()
    for n in (self.branch + self.node.ancestors()):
        if self.permit(n.expns):
            s.add(n.expns)
        s = s.union(self.pset(n))
    return s
