Add item uri:prefix for `module` to `self.namespaces`.

        The prefix to be actually used for `uri` is returned.  If the
        namespace is already present, the old prefix is used.  Prefix
        clashes are resolved by disambiguating `prefix`.

def add_namespace(self, module):
        """Add item uri:prefix for `module` to `self.namespaces`.

        The prefix to be actually used for `uri` is returned.  If the
        namespace is already present, the old prefix is used.  Prefix
        clashes are resolved by disambiguating `prefix`.
        """
        uri = module.search_one("namespace").arg
        prefix = module.search_one("prefix").arg
        if uri in self.namespaces: return self.namespaces[uri]
        end = 1
        new = prefix
        while new in list(self.namespaces.values()):
            new = "%s%x" % (prefix,end)
            end += 1
        self.namespaces[uri] = new
        self.module_prefixes[module.arg] = new
        for inc in module.search("include"):
            self.module_prefixes[inc.arg] = new
        return new