question: public static String resolveEntities ( String text ) { int ampIndex = text . indexOf ( '&' ) ; if ( ampIndex == - 1 ) { return text ; } StringBuilder sb = new StringBuilder ( ( int ) ( 1.1 * text . length ( ) ) ) ; int prevIndex = 0 ; while ( ampIndex >= 0 ) { int colonIndex = text . indexOf ( ';' , ampIndex ) ; sb . append ( text . substring ( prevIndex , ampIndex ) ) ; sb . append ( resolveEntity ( text . substring ( ampIndex + 1 , colonIndex ) ) ) ; prevIndex = colonIndex + 1 ; ampIndex = text . indexOf ( '&' , prevIndex ) ; } sb . append ( text . substring ( prevIndex ) ) ; return sb . toString ( ) ; }
target:  Replaces all XML character entities with the character they represent.