if ( !( c == 0x9 || c == 0xA || c == 0xD || ( c >= 0x20 && c <= 0xD7FF ) || ( c >= 0xE000 && c <= 0xFFFD ) ) ) {  replacement = ""; log.warn( "Ignore the illegal XML character: 0x" + Integer.toHexString( c ) + ";" ); }
	protected String getEscapedStr( String s, boolean whitespace )	{		StringBuffer result = null;		for ( int i = 0, max = s.length( ), delta = 0; i < max; i++ )		{			char c = s.charAt( i );			String replacement = null;			if ( c == '&' )			{				replacement = "&amp;"; //$NON-NLS-1$			}			else if ( c == '<' )			{				replacement = "&lt;"; //$NON-NLS-1$			}			else if ( c == '\r' )			{				replacement = "&#13;"; //$NON-NLS-1$			}			else if ( c == '>' )			{				replacement = "&gt;"; //$NON-NLS-1$			}			else if ( c == '"' )			{				replacement = "&quot;"; //$NON-NLS-1$			}			else if ( c == '\'' )			{				replacement = "&apos;"; //$NON-NLS-1$			}			else if ( whitespace && c == ' ' )			{				replacement = "&#160;"; //$NON-NLS-1$			}			else if ( c >= 0x80 )			{				replacement = "&#x" + Integer.toHexString( c ) + ';'; //$NON-NLS-1$ 			}			if ( replacement != null )			{				if ( result == null )				{					result = new StringBuffer( s );				}				result.replace( i + delta, i + delta + 1, replacement );				delta += ( replacement.length( ) - 1 );			}		}		if ( result == null )		{			return s;		}		return result.toString( );	}