XWIKI-9349: Introduce output instance component for WikiStream
* reduce code duplication
(cherry picked from commit 28e55660bf5e0c747dcc4d1e9b63e303fc7094a0)