@classmethod
    def parse_xml(cls, source):
        if isinstance(source, basestring):
            source = ET.fromstring(source)

        if source.tag != 'response':
            raise TypeError('Message does not know how to decode this')

        ret = cls()

        for attr, value in source.attrib.iteritems():
            ret.set(attr, value)

        for err in source.findall('error'):
            ret.add_error(err.text)
            source.remove(err)

        for errs in source.findall('errors'):
            source.remove(errs)

        children = source.getchildren()
        child = children[0] if len(children) else None
        if child is not None:
            c = MessageElement.parse_xml(child)
            ret._root = c

        return ret

    #Properties
Granting moderator privileges sends request to set role to 'moderator'.
dataset/ETHPy150Open flosch/simpleapi/example_project/client/python/sapi/message.py/Message.parse_xml--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_muc.py/MUCClientProtocolTest.test_grantModerator