question: protected Character isWFXMLChar ( String chardata ) { Character refInvalidChar ; if ( chardata == null || ( chardata . length ( ) == 0 ) ) { return null ; } char [ ] dataarray = chardata . toCharArray ( ) ; int datalength = dataarray . length ; if ( fIsXMLVersion11 ) { int i = 0 ; while ( i < datalength ) { if ( XML11Char . isXML11Invalid ( dataarray [ i ++ ] ) ) { char ch = dataarray [ i - 1 ] ; if ( XMLChar . isHighSurrogate ( ch ) && i < datalength ) { char ch2 = dataarray [ i ++ ] ; if ( XMLChar . isLowSurrogate ( ch2 ) && XMLChar . isSupplemental ( XMLChar . supplemental ( ch , ch2 ) ) ) { continue ; } } refInvalidChar = new Character ( ch ) ; return refInvalidChar ; } } } else { int i = 0 ; while ( i < datalength ) { if ( XMLChar . isInvalid ( dataarray [ i ++ ] ) ) { char ch = dataarray [ i - 1 ] ; if ( XMLChar . isHighSurrogate ( ch ) && i < datalength ) { char ch2 = dataarray [ i ++ ] ; if ( XMLChar . isLowSurrogate ( ch2 ) && XMLChar . isSupplemental ( XMLChar . supplemental ( ch , ch2 ) ) ) { continue ; } } refInvalidChar = new Character ( ch ) ; return refInvalidChar ; } } } return null ; }
target:  Checks if a XML character is well-formed.  If there is a problem with the character a non-null Character is returned else null is returned.