escapeXML « XML « JSP-Servlet Q&A

1. How to tell Java which StringEscapeUtils.escapeXML() to use?

I'm trying to use the StringEscapeUtils.escapeXML() function from org.apache.commons.lang... There are two versions of that function, one which expects (Writer, String) and one which just expects (String).... I'm trying to use ...

2. What is the difference between escapeXml and escapeHtml?

I would like to escape characters in JSP pages. Which is more suitable, escapeXml or escapeHtml?