def text(self, text):
    self.__close_start_tag()
    if (('<' in text) and ('>' in text) and (not (']]>' in text))):
        self.stream.write('<![CDATA[')
        self.stream.write(text)
        self.stream.write(']]>')
    else:
        self.stream.write(escape(text, ESCAPE_ENTITIES))
def text(self, text):
    self.__close_start_tag()
    if (('<' in text) and ('>' in text) and (not (']]>' in text))):
        self.stream.write('<![CDATA[')
        self.stream.write(text)
        self.stream.write(']]>')
    else:
        self.stream.write(escape(text, ESCAPE_ENTITIES))