Java tutorial
//package com.java2s; //License from project: Apache License import static java.lang.String.format; public class Main { public static String aggregatedTextStartsWith(final String text) { return format("starts-with(%s, '%s')", translateTextForPath("normalize-space(string(.))"), text.toLowerCase()); } public static String translateTextForPath(String txt) { return format("translate(%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')", txt); } }