1. A method comprising: converting a medical document having rich formatting into a first XHTML document; generating a plain text document from the first XHTML document; generating one or more annotations of the plain text document by applying a natural language understanding (NLU) engine implemented on a processor to the plain text document; and creating an annotated XHTML document by applying the one or more annotations of the plain text document to a tokenized XHTML document representing the medical document.