'Get a string representation for all namespace declarations
as xmlns="" and xmlns:p="".
@return: A separated list of declarations.
@rtype: basestring'

def nsdeclarations(self):

    s = []
    myns = (None, self.expns)
    if (self.parent is None):
        pns = Namespace.default
    else:
        pns = (None, self.parent.expns)
    if (myns[1] != pns[1]):
        if (self.expns is not None):
            d = ('    xmlns="%s"' % self.expns)
            s.append(d)
    for item in self.nsprefixes.items():
        (p, u) = item
        if (self.parent is not None):
            ns = self.parent.resolvePrefix(p)
            if (ns[1] == u):
                continue
        d = ('    xmlns:%s="%s"' % (p, u))
        s.append(d)
    return ''.join(s)
