Here you can find the source of classToXMLName(Class
public static <T> String classToXMLName(Class<T> klass)
//package com.java2s; //License from project: Open Source License public class Main { public static <T> String classToXMLName(Class<T> klass) { return dasherize(klass.getSimpleName()).toLowerCase(); }/*from w ww .j av a 2s.co m*/ public static String dasherize(String str) { if (str == null) return null; return str.replaceAll("([A-Z]+)([A-Z][a-z])", "$1-$2").replaceAll("([a-z])([A-Z])", "$1-$2") .replaceAll("_", "-").toLowerCase(); } }