DocumentContainer docContainer = DocumentContainer.getInstance();
String original = docContainer.getElementAsStringFor(id, DocumentContainer.MASTER);
for(TCLink link : matches){
String match = docContainer.getElementAsStringFor(link.getCurrentDerivedId(),DocumentContainer.DERIVED);
String highlighted = new XMLHighlighter(new EEBOPreprocessing()).produceHighlightedText(match, original);
List<TCNote> notes = DBManager.getInstance().getNotesFor(TCNote.TYPE_PARAGRAPH, link.getCurrentDerivedId());
List<TCNote> linkNotes = DBManager.getInstance().getNotesFor(TCNote.TYPE_LINK, link.getCurrentDerivedId());
notes.addAll(linkNotes);
foundMatches.add(new Match(highlighted, link, notes));
}