'Sets the text property of this instance.
:param val: The value of the text property
:param base64encode: Whether the value should be base64encoded
:return: The instance'

def set_text(self, val, base64encode=False):

    if isinstance(val, bool):
        if val:
            setattr(self, 'text', 'true')
        else:
            setattr(self, 'text', 'false')
    elif isinstance(val, int):
        setattr(self, 'text', ('%d' % val))
    elif isinstance(val, basestring):
        setattr(self, 'text', val)
    elif (val is None):
        pass
    else:
        raise ValueError(("Type    shouldn't    be    '%s'" % (val,)))
    return self
