private IDOMModel initializeXMLModel(IFile file, boolean forWrite) throws UnsupportedEncodingException, IOException {
if (file == null || !file.exists())
throw new FileNotFoundException((file == null) ? "null" : file.getFullPath().toOSString()); //$NON-NLS-1$
try {
IModelManager manager = getModelManager();
String id = manager.calculateId(file);
if (forWrite) {
IDOMModel mod = (IDOMModel)manager.getExistingModelForEdit(id);
if (mod == null)
setXMLModel((IDOMModel) manager.getModelForEdit(file));
else {