I don't agree, I think XMPP could be good solution, while yes attack surface is quite large but it will be in any case, because even if you create the very minimalist chat protocol possible (let's say basically use asymmetric cryptography for messages which are plaintext without any features) you still can have bugs in cryptography library, network stack, OS/kernel. This part will be same no matter what messaging protocol you use. So by changing plaintext to other payload such as XMPP we introduce another layer but this layer could be parsed in a sandbox / virtual machine thus even if you receive malicious message it couldn't exploit other parts of your system and it would work exactly like that simple plaintext protocol. Now but what if there's a bug in cryptography library, well you have already lost even with your basic plaintext protocol...