code: private static String escapeXml(String input) {
          return input == null ? "" : input.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
      }
docs: Converts the incoming string to an escaped output string. This method is
  far from perfect, only escaping &lt;, &gt; and &amp; characters