separate transformer code into single method so if anyone wants to cater
for different XSLT impls then easier to do