There are many good articles in china.
How to do import OpenFire source code in server-side to Eclipse. you can read this article
What's the XMPP Protocol ? You can read this article