I always start with the standards. Typically you will find that engineering protocols are more simple than you think. But when there are lots of solutions it starts to cloud it.
Check the bottom of : http://www.ietf.org/rfc/rfc3920.txt
If you like to look at full products using the standard take a look at OpenFire; http://en.wikipedia.org/wiki/Openfire
It has most of the standards implemented and is open.
Then when you want to whip out a prototype in a few hours or minutes dig in with some python: http://xmpppy.sourceforge.net/