'Generate a prefix.
@param node: An XML node on which the prefix will be used.
@type node: L{sax.element.Element}
@param ns: A namespace needing an unique prefix.
@type ns: (prefix, uri)
@return: The I{ns} with a new prefix.'

@classmethod
def genprefix(cls, node, ns):

    for n in range(1, 1024):
        p = ('ns%d' % n)
        u = node.resolvePrefix(p, default=None)
        if ((u is None) or (u == ns[1])):
            return (p, ns[1])
    raise Exception('auto    prefix,    exhausted')
