// Lazy access to streams
if (elements == null) {
elements = new HashMap<String, Element>();
for (FileDescriptor fileDescriptor : getResources()) {
try {
SAXReader saxReader = new SAXReader();
saxReader.setMergeAdjacentText(true);
if (isSchemaValidating()) {
saxReader.setEntityResolver(new DTDEntityResolver());
saxReader.setValidation(true);
saxReader.setFeature("http://apache.org/xml/features/validation/schema",true);
}
elements.put(fileDescriptor.getName(), saxReader.read(fileDescriptor.getUrl().openStream()).getRootElement());
} catch (DocumentException dex) {
Throwable nested = dex.getNestedException();
if (nested != null) {
if (nested instanceof FileNotFoundException) {