Fixes and methods for getting document and it's
template from X-Road