'Add or change the message thread\'s parent thread.'

def set_parent_thread(self, value):

    thread = self.xml.find(('{%s}thread' % self.namespace))
    if value:
        if (thread is None):
            thread = ET.Element(('{%s}thread' % self.namespace))
            self.xml.append(thread)
        thread.attrib['parent'] = value
    elif ((thread is not None) and ('parent' in thread.attrib)):
        del thread.attrib['parent']
