'Invite a jid to a room.'

def invite(self, room, jid, reason='', mfrom=''):

    msg = self.xmpp.makeMessage(room)
    msg['from'] = mfrom
    x = ET.Element('{http://jabber.org/protocol/muc#user}x')
    invite = ET.Element('{http://jabber.org/protocol/muc#user}invite', {'to': jid})
    if reason:
        rxml = ET.Element('{http://jabber.org/protocol/muc#user}reason')
        rxml.text = reason
        invite.append(rxml)
    x.append(invite)
    msg.append(x)
    self.xmpp.send(msg)
