public void parse(
InputStream stream, ContentHandler handler,
Metadata metadata, ParseContext context)
throws IOException, SAXException, TikaException {
try {
DefaultStyledDocument sd = new DefaultStyledDocument();
new RTFEditorKit().read(stream, sd, 0);
XHTMLContentHandler xhtml =
new XHTMLContentHandler(handler, metadata);
xhtml.startDocument();
xhtml.element("p", sd.getText(0, sd.getLength()));
xhtml.endDocument();
} catch (BadLocationException e) {
throw new TikaException("Error parsing an RTF document", e);
} catch (InternalError e) {
throw new TikaException(