'Set the value of a top level attribute of the XML object.
If the new value is None or an empty string, then the attribute will
be removed.
:param name: The name of the attribute.
:param value: The new value of the attribute, or None or \'\' to
remove it.'

def _set_attr(self, name, value):

    if ((value is None) or (value == u'')):
        self.__delitem__(name)
    else:
        self.xml.attrib[name] = value
