((Model) treeNode).setNamespace(sbmlNamespace);
for (Object child : listOfElementsToWrite) {
if (child instanceof AbstractSBase && ((AbstractSBase) child).getNamespace() == null) {
AbstractSBase sbase = (AbstractSBase) child;
logger.debug("Found one suspect Model child: " + sbase.getElementName() + ". Setting the SBML namespace to it.");
sbase.setNamespace(sbmlNamespace);
}
}
}
return listOfElementsToWrite;