'Get an attribute by name and (optional) namespace
@param name: The name of a contained attribute (may contain prefix).
@type name: basestring
@param ns: An optional namespace
@type ns: (I{prefix}, I{name})
@param default: Returned when attribute not-found.
@type default: L{Attribute}
@return: The requested attribute object.
@rtype: L{Attribute}'

def getAttribute(self, name, ns=None, default=None):

    if (ns is None):
        (prefix, name) = splitPrefix(name)
        if (prefix is None):
            ns = None
        else:
            ns = self.resolvePrefix(prefix)
    for a in self.attributes:
        if a.match(name, ns):
            return a
    return default
