private ContentHandler getXmlContentHandler(Writer writer) throws TransformerConfigurationException {
        SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
        TransformerHandler handler = factory.newTransformerHandler();
        handler
                .getTransformer()
                .setOutputProperty(OutputKeys.METHOD, "xml");
        handler.setResult(new StreamResult(writer));
        return handler;
    }
Creates and returns a content handler that turns XHTML input to
simplified HTML output that can be correctly parsed and displayed
by {@link JEditorPane}.
<p>
The returned content handler is set to output <code>html</code>
to the given writer. The XHTML namespace is removed from the output
to prevent the serializer from using the &lt;tag/&gt; empty element
syntax that causes extra "&gt;" characters to be displayed.
The &lt;head&gt; tags are dropped to prevent the serializer from
generating a &lt;META&gt; content type tag that makes
{@link JEditorPane} fail thinking that the document character set
is inconsistent.
<p>
Additionally, it will use ImageSavingParser to re-write embedded:(image)
image links to be file:///(temporary file) so that they can be loaded.

@param writer output writer
@return HTML content handler
@throws TransformerConfigurationException if an error occurs
tika-app/src/main/java/org/apache/tika/gui/TikaGUI.java