<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addItem(self, title, link, description, date, append=True):
 """Insert an item."""

        item = self.rss.createElement('item')

        self.addElement(item, 'title', title)
        self.addElement(item, 'link', link)
        self.addElement(item, 'description', description)
        self.addElement(item, 'guid', link)
        self.addElement(item, 'pubDate', date)

        if append:
            self.channel.appendChild(item)
        else:
            elems = self.rss.getElementsByTagName('item')
            if elems:
                self.channel.insertBefore(item, elems[0])
            else:
                self.channel.appendChild(item)