Fix escaping of XML text and attributes

Currently, all XML special characters (<, >, &, ") are sent to the server verbatim, implying in invalid a
invalid session and dropping the connection.

How to reproduce the bug:

* Send any stanza with a text node containing <, > or & or an attribute containing ". OR;

* Run example/bot.c and sent a message with a special character to the bot. It will be disconnected from the server.

The linked branch fixes the bug.