'Set this node to I{nil} as defined by having an
attribute I{xsi:nil}=I{flag}.
@param flag: A flag inidcating how I{xsi:nil} will be set.
@type flag: boolean
@return: self
@rtype: L{Element}'

def setnil(self, flag=True):

    (p, u) = Namespace.xsins
    name = ':'.join((p, 'nil'))
    self.set(name, str(flag).lower())
    self.addPrefix(p, u)
    if flag:
        self.text = None
    return self
