Oh yeah, OMEMO in XMPP, Megolm in Matrix, and the Signal ratchet encryption are all similar enough to be considered equivalent by layman. So security of XMPP seems to be overall superior to Matrix due to dramatically less server state, and far less distribution of metadata in federation.