I'd rather have it the other way around: start from a solution that works (like Mattermost) and progressively plug XMPP into it. Mattermost and its friends have the huge advantage of having everything built-in and well working together, and if you take a good look at it XMPP should be more like a "compatibility protocol" on top of a working solution.