SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(sourcesXmlFile);
final WroModel model = new WroModel();
Group closureDepsGroup = new Group(GROUP_NAME_CLOSURE_DEPS);
final NodeList includeNodes = doc.getElementsByTagName(INCLUDE_EL);
for (int i = 0; i < includeNodes.getLength(); i++) {
Element include = (Element) includeNodes.item(i);
if (!include.hasAttribute(FILE_ATT)) {
throw new AssertionError("include elements must have a " + FILE_ATT + " attribute");
}
Collection<IncludesStream> streams = null;
try {
streams = openIncludesStream(parentSourcesXmlFile, include.getAttribute(FILE_ATT));
for (IncludesStream is : streams) {
InputStream stream = is.stream;
WroModel includedModel = createModel(is.locationLoadedFrom, stream);
for (Group group : includedModel.getGroups()) {
if (GROUP_NAME_CLOSURE_DEPS.equals(group.getName())) {
for (Resource resource : group.getResources()) {
closureDepsGroup.addResource(resource);
}
} else {