Java tutorial
//package com.java2s; //License from project: Apache License import static java.lang.String.format; public class Main { public static String textEndsWith(String text) { return format("substring(%s, string-length(text()) - string-length('%s') +1) = '%s'", translateTextForPath("text()"), text, text.toLowerCase()); } public static String translateTextForPath(String txt) { return format("translate(%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')", txt); } }