Perhaps you can do that with link-local XMPP, aka Bonjour? If not, then I can recommend using OpenFire. This is a free software XMPP server written in Java. It can integrate with your LDAP directory to automate setups of user accounts and pre-populate contact lists, etc. It also supports chat rooms.