code: protected static String escapeXmlSpecialCharacters(String aText) {
      String result = aText;
      result = result.replaceAll("&", "&amp;");
      result = result.replaceAll("\'", "\\\\&#039;");
      result = result.replaceAll("'", "\\\\&#039;");
      return result;
    }
docs: Android specific escaping of characters. Note that since this is no real XML escaping, the
  output string.xml file is potentially not valid XML. However this is explicitly allowed by
  Android.
  
  <P>
  The following characters are replaced with corresponding character entities :
  <table border='1' cellpadding='3' cellspacing='0' summary="' is replaced with char 39,
  amp is replaced with entity amp">
  <tr>
  <th>Character</th>
  <th>Encoding</th>
  </tr>
  <tr>
  <td>'</td>
  <td>\\&amp;#039;</td>
  </tr>
  <tr>
  <td>\'</td>
  <td>\\&amp;#039;</td>
  </tr>
  <tr>
  <td>&amp;</td>
  <td>&amp;amp;</td>
  </tr>
  </table>
  
  @param aText text to escape, must not be null
  @return escaped text