// Prepare the HTML content handler that generates proper
// XHTML events to records relevant document metadata
XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
XPathParser xpath = new XPathParser(null, "");
Matcher body = xpath.parse("/HTML/BODY//node()");
Matcher title = xpath.parse("/HTML/HEAD/TITLE//node()");
Matcher meta = xpath.parse("/HTML/HEAD/META//node()");
handler = new TeeContentHandler(
new MatchingContentHandler(getBodyHandler(xhtml), body),
new MatchingContentHandler(getTitleHandler(metadata), title),
new MatchingContentHandler(getMetaHandler(metadata), meta));