}
}
configFile.create(input, true, null);
} catch (CoreException e) {
throw new ArchMapperException(e);
}
Element root = new Element("beans");
root.setNamespace(springBeansNamespace);
Namespace schemaNS = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
root.addNamespaceDeclaration(schemaNS);
root.setAttribute("schemaLocation", "http://www.springframework.org/schema/beans/spring-beans.xsd", schemaNS);
doc.addContent(root);
} else {
SAXBuilder builder = new SAXBuilder();
try {
doc = builder.build(configFile.getContents(true));
} catch (Exception e) {
throw new ArchMapperException("Error reading existing config file: "+ e.getMessage(), e);
}
}
return doc;
}