Use XslCompiledTransform and remove some unnecessary IO

Change-Id: Iff0847808a3a23b6ea96825fb581de64a62e3afd