Implement XSLT transformation and do some cleanup

Change-Id: I989d85c99c2e6b8e88dde7875f522a538c2f0526