<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def assign_literal(element, value):
 u"""Assigns a literal. If a given node doesn't exist, it will be created. :param etree.Element element: element to which we assign. :param value: the value to assign """

        # Searches for a conversion method specific to the type of value.
        helper = helpers.CAST_DICT.get(type(value), str)

        # Removes all children and attributes.
        element.clear()
        element.text = helper(value)