Use XPath functions instead of case translation templates  #1507