parse XML as it comes through the socket

We cannot just use a simple line-based protocol to receive stanzas through
the socket as it cannot deal with newline characters embedded in messages.
As we have to parse the incoming data anyway, we can do so incrementally
using a SAX parser as we receive the stream through the socket.