*/
public Document getDocument() {
try{
InputStream is = tags_CaseSensitive
? new LookAheadStream(br, desiredEncoding == null ? end_docTag.getBytes() : end_docTag.getBytes(desiredEncoding))
: new LookAheadStreamCaseInsensitive(br, end_docTag);
return documentClass.getConstructor(InputStream.class, Map.class, Tokeniser.class).newInstance(is, DocProperties, tokeniser);
} catch (Exception e) {
throw new RuntimeException(e);
}
}