apache/commons-lang — pull request #15 by adamhooper (2014-01-31 17:22:10+00:00)
Title: Add escapeXml10 and escapeXml11

These methods turn any String into valid XML, hacking off characters when necessary. See https://issues.apache.org/jira/browse/LANG-955

* `escapeXml10` outputs a string that can be included in an XML 1.0 or XML 1.1 document.
* `escapeXml11` outputs a string that can be included in an XML 1.1 document.

Neither method escapes or omits what http://www.w3.org/TR/REC-xml/#charsets calls "discouraged" characters. Rationale: any valid XML parser will still read them, even though they're icky.