CMS-4028 Refactory xslt processor for better JS support.