def update(self, **kwargs):
        u"""Updating or creation of new simple nodes.

        Each dict key is used as a tagname and value as text.
        """
        for key, value in kwargs.items():
            helper = helpers.CAST_DICT.get(type(value), str)
            tag = self._get_aliases().get(key, key)

            elements = list(self._xml.iterchildren(tag=tag))
            if elements:
                for element in elements:
                    element.text = helper(value)
            else:
                element = etree.Element(key)
                element.text = helper(value)
                self._xml.append(element)
                self._aliases = None
def update ( self , ** kwargs ) : for key , value in kwargs . items ( ) : helper = helpers . CAST_DICT . get ( type ( value ) , str ) tag = self . _get_aliases ( ) . get ( key , key ) elements = list ( self . _xml . iterchildren ( tag = tag ) ) if elements : for element in elements : element . text = helper ( value ) else : element = etree . Element ( key ) element . text = helper ( value ) self . _xml . append ( element ) self . _aliases = None
u"""Updating or creation of new simple nodes.

        Each dict key is used as a tagname and value as text.