Document doc = null;
try {
String content = designTime.getTemplateContent(templatePath);
if (content == null) {
content = Util.readStreamAsString(resource.openContents());
}
doc = new W3cDomHelper(logger.getTreeLogger(), resourceOracle).documentFor(
content, resource.getPath());
} catch (SAXParseException e) {
logger.die(