I want to escape special characters in XML using java. I found there is apache common-text lib which contains class i.e StringEscapeUtils but I have a different case. I want