public String parseEmbeddedExample() throws IOException, SAXException, TikaException {
        AutoDetectParser parser = new AutoDetectParser();
        BodyContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();
        ParseContext context = new ParseContext();
        context.set(Parser.class, parser);
        try (InputStream stream = ParsingExample.class.getResourceAsStream("test_recursive_embedded.docx")) {
            parser.parse(stream, handler, metadata, context);
            return handler.toString();
        }
    }
This example shows how to extract content from the outer document and all
embedded documents.  The key is to specify a {@link Parser} in the {@link ParseContext}.

@return content, including from embedded documents
@throws IOException
@throws SAXException
@throws TikaException
tika-example/src/main/java/org/apache/tika/example/ParsingExample.java