I second "XMPP: The Definitive Guide" as a way to really understand what is happening behind-the-scenes. It's very accessible and does go into enough depth that you can figure things out for yourself afterwards.
I would recommend you not go with the "Professional XMPP Programming" book though. I purchased both of these together and I was not able to run even a single example app in the latter book as the BOSH stuff he is using would just not work (there is a problem with the newer browsers and his implementation of running cross-site AJAX). There are complaints on the forums for that book but are largely unanswered.
After going through all servers and libraries, I can recommend ejabberd as it seems to be the most stable and easy to set up. For libraries, I found MatriX to be the best (and only one that I could actually do any programming for). I am trying to use .Net though, so YMMV MatriX is the newer version of agsxmpp mentioned above.