public static void unescapeXml(final String text, final Writer writer)
            throws IOException {

        if (writer == null) {
            throw new IllegalArgumentException("Argument 'writer' cannot be null");
        }
        if (text == null) {
            return;
        }
        if (text.indexOf('&') < 0) {
            // Fail fast, avoid more complex (and less JIT-table) method to execute if not needed
            writer.write(text);
            return;
        }

        // The chosen symbols (1.0 or 1.1) don't really matter, as both contain the same CERs
        XmlEscapeUtil.unescape(new InternalStringReader(text), writer, XmlEscapeSymbols.XML11_SYMBOLS);

    }
public static void unescapeXml ( final String text , final Writer writer ) throws IOException { if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( text == null ) { return ; } if ( text . indexOf ( '&' ) < 0 ) { writer . write ( text ) ; return ; } XmlEscapeUtil . unescape ( new InternalStringReader ( text ) , writer , XmlEscapeSymbols . XML11_SYMBOLS ) ; }
<p>
Perform an XML <strong>unescape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> XML 1.0/1.1 unescape of CERs, decimal
and hexadecimal references.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>

@param text the <tt>String</tt> to be unescaped.
@param writer the <tt>java.io.Writer</tt> to which the unescaped result will be written. Nothing will
be written at all to this writer if input is <tt>null</tt>.
@throws IOException if an input/output exception occurs

@since 1.1.2