protected String XMLNormalize(String sStr){
  StringBuffer sStr2=new StringBuffer();
  for (int iStr=0; iStr < sStr.length(); iStr++) {
    char c=sStr.charAt(iStr);
switch (c) {
case '&':
      sStr2.append("&amp;");
    break;
case '\'':
  sStr2.append("&apos;");
break;
case '\"':
sStr2.append("&quot;");
break;
case '<':
sStr2.append("&lt;");
break;
case '>':
sStr2.append("&gt;");
break;
default :
sStr2.append(c);
}
}
return sStr2.toString();
}

protected String XMLNormalize ( String sStr ) { StringBuffer sStr2 = new StringBuffer ( ) ; for ( int iStr = 0 ; iStr < sStr . length ( ) ; iStr ++ ) { char c = sStr . charAt ( iStr ) ; switch ( c ) { case '&' : sStr2 . append ( "&amp;" ) ; break ; case '\'' : sStr2 . append ( "&apos;" ) ; break ; case '\"' : sStr2 . append ( "&quot;" ) ; break ; case '<' : sStr2 . append ( "&lt;" ) ; break ; case '>' : sStr2 . append ( "&gt;" ) ; break ; default : sStr2 . append ( c ) ; } } return sStr2 . toString ( ) ; }
xmlnormalize converts the five standard xml entities in a string g . e . the string v & d ' s is returned as v & amp ; d & apos ; s
