When transforming a relation resource into a document, a new core session is opened.
This could be avoided using the session id as a reference for an existing session.
Some API needs to be added so that this context variable (the session id) can be passed to the transformation chain.