}
/* In case of an exception */
if (ex != null && document == null && Activator.getDefault() != null) {
if (!usePlatformEncoding && encodingIssue)
throw new EncodingException(Activator.getDefault().createErrorStatus(ex.getMessage(), ex));
throw new ParserException(Activator.getDefault().createErrorStatus(ex.getMessage(), ex));
}
/* Return Document */
return document;