def toElement(self):
    element = domish.Element((NS_MUC_ADMIN, 'item'))
    if self.entity:
        element['jid'] = self.entity.full()
    if self.nick:
        element['nick'] = self.nick
    if self.affiliation:
        element['affiliation'] = self.affiliation
    if self.role:
        element['role'] = self.role
    if self.reason:
        element.addElement('reason', content=self.reason)
    return element
def toElement(self):
    element = domish.Element((NS_MUC_ADMIN, 'item'))
    if self.entity:
        element['jid'] = self.entity.full()
    if self.nick:
        element['nick'] = self.nick
    if self.affiliation:
        element['affiliation'] = self.affiliation
    if self.role:
        element['role'] = self.role
    if self.reason:
        element.addElement('reason', content=self.reason)
    return element