private void printString(Writer out,String str) throws IOException {
  str=Text.normalizeString(str);
  str=str.trim();
  out.write(escapeElementEntities(str));
}

private void printString ( Writer out , String str ) throws IOException { str = Text . normalizeString ( str ) ; str = str . trim ( ) ; out . write ( escapeElementEntities ( str ) ) ; }
this will handle printing a string . escapes the element entities , trims interior whitespace , etc . if necessary .
