code: static public String normalise(String s) 
      {
          StringBuffer str = new StringBuffer();
  
          int len = (s != null) ? s.length() : 0;
          for (int i = 0; i < len; i++) 
          {
              char ch = s.charAt(i);
              switch (ch) 
              {
                  case '<': 
                  {
                      str.append("&lt;");
                      break;
                  }
                  case '>': 
                  {
                      str.append("&gt;");
                      break;
                  }
                  case '&': 
                  {
                      str.append("&amp;");
                      break;
                  }
                  case '"': 
                  {
                      str.append("&quot;");
                      break;
                  }
                  case '\'': 
                  {
                      str.append("&apos;");
                      break;
                  }
                  default: 
                  {
                      str.append(ch);
                  }
              }
          }
          return str.toString();    
      }
docs: Normalises the given string, replacing certain special characters with their HTML escape sequences.
  <UL>
  <LI> <B><CODE>&lt;</CODE></B> becomes <B><CODE>&amp;lt;</CODE></B>
  <LI> <B><CODE>&gt;</CODE></B> becomes <B><CODE>&amp;gt;</CODE></B>
  <LI> <B><CODE>&amp;</CODE></B> becomes <B><CODE>&amp;amp;</CODE></B>
  <LI> <B><CODE>&quot;</CODE></B> becomes <B><CODE>&amp;quot;</CODE></B>
  <LI> <B><CODE>'</CODE></B> becomes <B><CODE>&amp;apos;</CODE></B>
  </UL>
  @param s The string to be normalised
  @return The normalised string