Web-chat

Hi, I want to write an XMPP transport to the custom web-chat. Where can I find manuals and

sample code (some opensource IRC transport for example)?