Should I build from source or write a plugin

Dear all,

I need to use XMPP for an application backend service. I am now considering to customize a xmpp server. I know that I am not only using to to implement a chat service but also as a protocol for other functionality.

But how can I know whether I should build from the source or write a plugin or use the XMPP library to do everything from scratch.

Can you all give me some suggestion?

Thanks.

Regards,

Cato