Basically, chatting is message oriented, but the XMPP inventors thought it would be neat to start the connection with a tag like <beginconversation> which would then be dangling for the whole connection, preventing the use of a simple DOM XML parser (remember this is many years ago) for each message.
Just an example, here is the XML parser that I wrote in PHP https://github.com/movim/movim/blob/master/lib/moxl/src/Moxl... (127 lines), it basically handle the stream as an input and fire SimpleXML (can also be DOM XML) on the other hand.
This can handle thousands of XMPP messages (called stanza) per second :)
curl 'https://matrix.org/_matrix/client/r0/rooms/!RXNcERlITUVszBNIPW%3Amatrix.org/send/m.room.message/123?access_token='$TOKEN -X PUT --data '{"msgtype":"m.text","body":"hello world"}'
and to receive messages it's: curl 'https://matrix.org/_matrix/client/r0/sync?access_token='$TOKEN
Hopefully this ends up being quite easy to work with :) <message to="user@server.com"><body>Hello world</body></message>
No need for a token, the socket you're in is already authenticated :)HTPP's fine, I guess. It's certainly available everywhere, and saves one from writing a bunch of tiresome parsing code. But that's really an indictment of the current state of our technology. Popular languages should make it easy to read structured data out of a socket (with some sort of max length to prevent DDoSes) & write structured data to a socket. Since they don't, HTTP is an okay compromise. It's a bit heavyweight, but it gets the job done.