[418466] Implementing resource handlers and extended metadata.
diff --git a/plugins/org.eclipse.uml2.uml.resources/plugin.xml b/plugins/org.eclipse.uml2.uml.resources/plugin.xml
index 3ec62f4..219562c 100644
--- a/plugins/org.eclipse.uml2.uml.resources/plugin.xml
+++ b/plugins/org.eclipse.uml2.uml.resources/plugin.xml
@@ -2,7 +2,7 @@
 <?eclipse version="3.0"?>
 
 <!--
- Copyright (c) 2005, 2011 IBM Corporation, Embarcadero Technologies, CEA, and others.
+ Copyright (c) 2005, 2014 IBM Corporation, Embarcadero Technologies, CEA, and others.
  All rights reserved.   This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v1.0
  which accompanies this distribution, and is available at
@@ -11,9 +11,8 @@
  Contributors: 
    IBM - initial API and implementation
    Kenn Hussey (Embarcadero Technologies) - 215488
-   Kenn Hussey (CEA) - 327039
+   Kenn Hussey (CEA) - 327039, 418466
 
- $Id: plugin.xml,v 1.2 2008/02/25 21:15:50 khussey Exp $
 -->
 
 <plugin>
@@ -47,4 +46,9 @@
     <profile uri="http://www.eclipse.org/uml2/schemas/Ecore/5" location="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
   </extension>
 
+  <extension
+     point="org.eclipse.uml2.uml.dynamic_package">
+    <profile uri="http://www.eclipse.org/uml2/schemas/UML2/2" location="pathmap://UML_PROFILES/UML2.profile.uml#_0"/>
+  </extension>
+
 </plugin>
diff --git a/plugins/org.eclipse.uml2.uml.resources/src/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.java b/plugins/org.eclipse.uml2.uml.resources/src/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.java
index 395e81f..7148412 100644
--- a/plugins/org.eclipse.uml2.uml.resources/src/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.java
+++ b/plugins/org.eclipse.uml2.uml.resources/src/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.java
@@ -35,6 +35,7 @@
 import org.eclipse.uml2.uml.resource.UML212UMLResource;
 import org.eclipse.uml2.uml.resource.UML22UMLResource;
 import org.eclipse.uml2.uml.resource.UML302UMLResource;
+import org.eclipse.uml2.uml.resource.UML402UMLResource;
 import org.eclipse.uml2.uml.resource.UMLResource;
 import org.eclipse.uml2.uml.resource.XMI2UMLResource;
 import org.eclipse.uml2.uml.resources.ResourcesPlugin;
@@ -74,7 +75,8 @@
 	private static final ContentHandler UML2_4_0_0_CONTENT_HANDLER = new RootXMLContentHandlerImpl(
 		UMLResource.UML_4_0_0_CONTENT_TYPE_IDENTIFIER,
 		new String[]{UMLResource.FILE_EXTENSION},
-		RootXMLContentHandlerImpl.XMI_KIND, UML2_UML_PACKAGE_4_0_NS_URI, null);
+		RootXMLContentHandlerImpl.XMI_KIND,
+		UML402UMLResource.UML_METAMODEL_NS_URI, null);
 
 	private static final ContentHandler UML2_5_0_0_CONTENT_HANDLER = new RootXMLContentHandlerImpl(
 		UMLResource.UML_5_0_0_CONTENT_TYPE_IDENTIFIER,
@@ -236,19 +238,21 @@
 
 		packageRegistry.put(UML212UMLResource.UML_METAMODEL_NS_URI,
 			UMLPackage.eINSTANCE);
+
 		packageRegistry.put(UML302UMLResource.UML_METAMODEL_NS_URI,
 			UMLPackage.eINSTANCE);
 
-		packageRegistry.put(UML2_UML_PACKAGE_4_0_NS_URI, UMLPackage.eINSTANCE);
+		packageRegistry.put(UML402UMLResource.UML_METAMODEL_NS_URI,
+			UMLPackage.eINSTANCE);
 
 		packageRegistry.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
 
-		packageRegistry.put(UML302UMLResource.STANDARD_PROFILE_NS_URI,
+		packageRegistry.put(UML212UMLResource.STANDARD_PROFILE_NS_URI,
 			StandardPackage.eINSTANCE);
 
-		packageRegistry.put(UMLResource.STANDARD_L2_PROFILE_NS_URI,
+		packageRegistry.put(UML402UMLResource.STANDARD_L2_PROFILE_NS_URI,
 			StandardPackage.eINSTANCE);
-		packageRegistry.put(UMLResource.STANDARD_L3_PROFILE_NS_URI,
+		packageRegistry.put(UML402UMLResource.STANDARD_L3_PROFILE_NS_URI,
 			StandardPackage.eINSTANCE);
 
 		packageRegistry.put(StandardPackage.eNS_URI, StandardPackage.eINSTANCE);
@@ -418,19 +422,15 @@
 	 */
 	public static Map<String, URI> initEPackageNsURIToProfileLocationMap(
 			Map<String, URI> ePackageNsURIToProfileLocationMap) {
-		ePackageNsURIToProfileLocationMap.put(
-			UMLResource.STANDARD_L2_PROFILE_NS_URI,
-			URI.createURI("pathmap://UML_PROFILES/Standard.profile.uml#_0")); //$NON-NLS-1$
-		ePackageNsURIToProfileLocationMap.put(
-			UMLResource.STANDARD_L3_PROFILE_NS_URI,
-			URI.createURI("pathmap://UML_PROFILES/Standard.profile.uml#_0")); //$NON-NLS-1$
-
 		ePackageNsURIToProfileLocationMap.put(StandardPackage.eNS_URI,
 			URI.createURI("pathmap://UML_PROFILES/Standard.profile.uml#_0")); //$NON-NLS-1$
 
 		ePackageNsURIToProfileLocationMap.put(UMLResource.ECORE_PROFILE_NS_URI,
 			URI.createURI("pathmap://UML_PROFILES/Ecore.profile.uml#_0")); //$NON-NLS-1$
 
+		ePackageNsURIToProfileLocationMap.put(UMLResource.UML2_PROFILE_NS_URI,
+			URI.createURI("pathmap://UML_PROFILES/UML2.profile.uml#_0")); //$NON-NLS-1$
+
 		return ePackageNsURIToProfileLocationMap;
 	}
 
diff --git a/plugins/org.eclipse.uml2.uml/plugin.properties b/plugins/org.eclipse.uml2.uml/plugin.properties
index 2496429..5e300e4 100644
--- a/plugins/org.eclipse.uml2.uml/plugin.properties
+++ b/plugins/org.eclipse.uml2.uml/plugin.properties
@@ -230,6 +230,7 @@
 _UI_OMG_UML_2_3_content_type = OMG UML 2.3 File
 _UI_OMG_UML_2_4_content_type = OMG UML 2.4 File
 _UI_OMG_UML_2_4_1_content_type = OMG UML 2.4.1 File
+_UI_OMG_UML_2_5_content_type = OMG UML 2.5 File
 
 _UI_OMG_CMOF_content_type = OMG CMOF File
 _UI_OMG_CMOF_2_0_content_type = OMG CMOF 2.0 File
diff --git a/plugins/org.eclipse.uml2.uml/plugin.xml b/plugins/org.eclipse.uml2.uml/plugin.xml
index 1997234..be960bf 100644
--- a/plugins/org.eclipse.uml2.uml/plugin.xml
+++ b/plugins/org.eclipse.uml2.uml/plugin.xml
@@ -283,7 +283,7 @@
            base-type="org.omg.uml"
            file-extensions="xmi"
            id="org.omg.uml_2_5"
-           name="%_UI_OMG_UML_2_4_1_content_type"
+           name="%_UI_OMG_UML_2_5_content_type"
            priority="normal">
         <describer
               class="org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl$Describer">
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML212UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML212UMLHandler.java
index a84c5ff..9e81b15 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML212UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML212UMLHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011 IBM Corporation, CEA, and others.
+ * Copyright (c) 2008, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039
+ *   Kenn Hussey (CEA) - 327039, 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
@@ -15,15 +15,12 @@
 import java.util.Map;
 
 import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EFactory;
 import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.xmi.XMLHelper;
 import org.eclipse.emf.ecore.xmi.XMLResource;
 import org.eclipse.emf.ecore.xml.type.AnyType;
 import org.eclipse.uml2.uml.resource.UML212UMLExtendedMetaData;
-import org.eclipse.uml2.uml.resource.UML302UMLResource;
 
 /**
  * Handler that converts .uml models.
@@ -35,16 +32,6 @@
 public class UML212UMLHandler
 		extends UMLHandler {
 
-	protected static final String STANDARD_L3_PROFILE_NS_PREFIX = "l3"; //$NON-NLS-1$
-
-	protected static final String STANDARD_PROFILE_NS_PREFIX = "Standard"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__BUILD_COMPONENT = "BuildComponent"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__METAMODEL = "Metamodel"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__SYSTEM_MODEL = "SystemModel"; //$NON-NLS-1$
-
 	public UML212UMLHandler(XMLResource xmiResource, XMLHelper helper,
 			Map<?, ?> options) {
 		super(xmiResource, helper, options);
@@ -86,37 +73,4 @@
 		}
 	}
 
-	@Override
-	protected EObject createObjectByType(String prefix, String name, boolean top) {
-		return super
-			.createObjectByType(
-				STANDARD_PROFILE_NS_PREFIX.equals(prefix)
-					&& (STEREOTYPE__BUILD_COMPONENT.equals(name)
-						|| STEREOTYPE__METAMODEL.equals(name) || STEREOTYPE__SYSTEM_MODEL
-							.equals(name))
-					? STANDARD_L3_PROFILE_NS_PREFIX
-					: prefix, name, top);
-	}
-
-	@Override
-	protected EFactory getFactoryForPrefix(String prefix) {
-
-		if (STANDARD_L3_PROFILE_NS_PREFIX.equals(prefix)) {
-			EFactory factory = prefixesToFactories.get(prefix);
-
-			if (factory == null) {
-				EPackage ePackage = getPackageForURI(UML302UMLResource.STANDARD_L3_PROFILE_NS_URI);
-
-				if (ePackage != null) {
-					factory = ePackage.getEFactoryInstance();
-					prefixesToFactories.put(prefix, factory);
-				}
-			}
-
-			return factory;
-		}
-
-		return super.getFactoryForPrefix(prefix);
-	}
-
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML22UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML22UMLHandler.java
index f360236..bd2cec7 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML22UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML22UMLHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011 IBM Corporation, CEA, and others.
+ * Copyright (c) 2006, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039
+ *   Kenn Hussey (CEA) - 327039, 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
@@ -22,22 +22,13 @@
 import org.eclipse.emf.ecore.xmi.XMLHelper;
 import org.eclipse.emf.ecore.xmi.XMLResource;
 import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.uml2.uml.UMLPackage;
 import org.eclipse.uml2.uml.resource.UML22UMLExtendedMetaData;
-import org.eclipse.uml2.uml.resource.UML302UMLResource;
+import org.eclipse.uml2.uml.resource.UMLResource;
 
 public class UML22UMLHandler
 		extends UMLHandler {
 
-	protected static final String STANDARD_L3_PROFILE_NS_PREFIX = "l3"; //$NON-NLS-1$
-
-	protected static final String STANDARD_PROFILE_NS_PREFIX = "Standard"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__BUILD_COMPONENT = "BuildComponent"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__METAMODEL = "Metamodel"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__SYSTEM_MODEL = "SystemModel"; //$NON-NLS-1$
-
 	public UML22UMLHandler(XMLResource xmiResource, XMLHelper helper,
 			Map<?, ?> options) {
 		super(xmiResource, helper, options);
@@ -80,25 +71,15 @@
 	}
 
 	@Override
-	protected EObject createObjectByType(String prefix, String name, boolean top) {
-		return super
-			.createObjectByType(
-				STANDARD_PROFILE_NS_PREFIX.equals(prefix)
-					&& (STEREOTYPE__BUILD_COMPONENT.equals(name)
-						|| STEREOTYPE__METAMODEL.equals(name) || STEREOTYPE__SYSTEM_MODEL
-							.equals(name))
-					? STANDARD_L3_PROFILE_NS_PREFIX
-					: prefix, name, top);
-	}
-
-	@Override
 	protected EFactory getFactoryForPrefix(String prefix) {
 
-		if (STANDARD_L3_PROFILE_NS_PREFIX.equals(prefix)) {
+		if ("Basic_0".equals(prefix) || "Intermediate_0".equals(prefix) //$NON-NLS-1$ //$NON-NLS-2$
+			|| "Complete_0".equals(prefix)) { //$NON-NLS-1$
+
 			EFactory factory = prefixesToFactories.get(prefix);
 
 			if (factory == null) {
-				EPackage ePackage = getPackageForURI(UML302UMLResource.STANDARD_L3_PROFILE_NS_URI);
+				EPackage ePackage = getPackageForURI(UMLResource.STANDARD_PROFILE_NS_URI);
 
 				if (ePackage != null) {
 					factory = ePackage.getEFactoryInstance();
@@ -112,4 +93,30 @@
 		return super.getFactoryForPrefix(prefix);
 	}
 
+	@SuppressWarnings("deprecation")
+	@Override
+	protected EObject createObjectFromFactory(EFactory factory, String typeName) {
+
+		if (typeName.startsWith("Basic__")) { //$NON-NLS-1$
+			typeName = typeName.substring(7);
+		} else if (typeName.startsWith("Intermediate__")) { //$NON-NLS-1$
+			typeName = typeName.substring(14);
+		} else if (typeName.startsWith("Complete__")) { //$NON-NLS-1$
+			typeName = typeName.substring(10);
+		}
+
+		return super.createObjectFromFactory(factory, typeName);
+	}
+
+	@Override
+	protected void setFeatureValue(EObject object, EStructuralFeature feature,
+			Object value, int position) {
+
+		if (feature == UMLPackage.Literals.OPERATION__TYPE) {
+			return;
+		}
+
+		super.setFeatureValue(object, feature, value, position);
+	}
+
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML302UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML302UMLHandler.java
index c0e6ba1..14658d8 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML302UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML302UMLHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 CEA and others.
+ * Copyright (c) 2011, 2014 CEA and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,37 +7,24 @@
  *
  * Contributors:
  *   CEA - initial API and implementation
+ *   Kenn Hussey (CEA) - 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
 
 import java.util.Map;
 
-import org.eclipse.uml2.uml.resource.UML302UMLExtendedMetaData;
-import org.eclipse.uml2.uml.resource.UML302UMLResource;
-
 import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EFactory;
 import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.xmi.XMLHelper;
 import org.eclipse.emf.ecore.xmi.XMLResource;
 import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.uml2.uml.resource.UML302UMLExtendedMetaData;
 
 public class UML302UMLHandler
 		extends UMLHandler {
 
-	protected static final String STANDARD_L3_PROFILE_NS_PREFIX = "l3"; //$NON-NLS-1$
-
-	protected static final String STANDARD_PROFILE_NS_PREFIX = "Standard"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__BUILD_COMPONENT = "BuildComponent"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__METAMODEL = "Metamodel"; //$NON-NLS-1$
-
-	protected static final String STEREOTYPE__SYSTEM_MODEL = "SystemModel"; //$NON-NLS-1$
-
 	public UML302UMLHandler(XMLResource xmiResource, XMLHelper helper,
 			Map<?, ?> options) {
 		super(xmiResource, helper, options);
@@ -79,37 +66,4 @@
 		}
 	}
 
-	@Override
-	protected EObject createObjectByType(String prefix, String name, boolean top) {
-		return super
-			.createObjectByType(
-				STANDARD_PROFILE_NS_PREFIX.equals(prefix)
-					&& (STEREOTYPE__BUILD_COMPONENT.equals(name)
-						|| STEREOTYPE__METAMODEL.equals(name) || STEREOTYPE__SYSTEM_MODEL
-							.equals(name))
-					? STANDARD_L3_PROFILE_NS_PREFIX
-					: prefix, name, top);
-	}
-
-	@Override
-	protected EFactory getFactoryForPrefix(String prefix) {
-
-		if (STANDARD_L3_PROFILE_NS_PREFIX.equals(prefix)) {
-			EFactory factory = prefixesToFactories.get(prefix);
-
-			if (factory == null) {
-				EPackage ePackage = getPackageForURI(UML302UMLResource.STANDARD_L3_PROFILE_NS_URI);
-
-				if (ePackage != null) {
-					factory = ePackage.getEFactoryInstance();
-					prefixesToFactories.put(prefix, factory);
-				}
-			}
-
-			return factory;
-		}
-
-		return super.getFactoryForPrefix(prefix);
-	}
-
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceFactoryImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceFactoryImpl.java
new file mode 100644
index 0000000..4b5411c
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceFactoryImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.uml2.uml.resource.UML402UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.UML402UMLResource;
+import org.eclipse.uml2.uml.resource.UML402UMLResourceHandler;
+import org.eclipse.uml2.uml.resource.UMLResource;
+
+/**
+ * Resource factory that converts .uml models.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0
+ * 
+ * @since 5.0
+ */
+public class UML402UMLResourceFactoryImpl
+		extends UMLResourceFactoryImpl
+		implements UML402UMLResource.Factory {
+
+	public UML402UMLResourceFactoryImpl() {
+		super();
+	}
+
+	@Override
+	public Resource createResourceGen(URI uri) {
+		UML402UMLResource result = new UML402UMLResourceImpl(uri);
+		result.setEncoding(UML402UMLResource.DEFAULT_ENCODING);
+		return result;
+	}
+
+	@Override
+	public Resource createResource(URI uri) {
+		UMLResource resource = (UMLResource) super.createResource(uri);
+
+		Map<Object, Object> defaultLoadOptions = resource
+			.getDefaultLoadOptions();
+
+		ExtendedMetaData extendedMetaData = new UML402UMLExtendedMetaData(
+			EPackage.Registry.INSTANCE);
+
+		defaultLoadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
+			extendedMetaData);
+		defaultLoadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
+			Boolean.FALSE);
+		defaultLoadOptions.put(XMLResource.OPTION_RESOURCE_HANDLER,
+			new UML402UMLResourceHandler());
+
+		return resource;
+	}
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceImpl.java
new file mode 100644
index 0000000..78adfda
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UML402UMLResourceImpl.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.uml2.uml.resource.UML402UMLResource;
+
+/**
+ * Resource that converts .uml models.
+ * OMG:  UML 2.4.x and UML 2.5 
+ * API:  UML2 4.x and UML2 5.0 
+ * 
+ * @since 5.0
+ */
+public class UML402UMLResourceImpl
+		extends UMLResourceImpl
+		implements UML402UMLResource {
+
+	public UML402UMLResourceImpl(URI uri) {
+		super(uri);
+	}
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLHandler.java
index 69d576b..153ccdc 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012 IBM Corporation, CEA, and others.
+ * Copyright (c) 2008, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039, 365027, 299527
+ *   Kenn Hussey (CEA) - 327039, 365027, 299527 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
@@ -128,35 +128,22 @@
 		} else if (uriLiteral
 			.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_1_1_URI)
 			|| uriLiteral
-				.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_1_URI)) {
-
-			int index = uriLiteral.indexOf('#');
-			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + "#_0"; //$NON-NLS-1$
-			} else {
-				String fragment = uriLiteral.substring(index);
-
-				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_NS_URI;
-				} else {
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + fragment;
-				}
-			}
-		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_URI)
+				.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_1_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_URI)
 			|| uriLiteral
 				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_1_URI)) {
 
 			int index = uriLiteral.indexOf('#');
 			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + "#_0"; //$NON-NLS-1$
+				uriLiteral = UMLResource.STANDARD_PROFILE_URI + "#_0"; //$NON-NLS-1$
 			} else {
 				String fragment = uriLiteral.substring(index);
 
 				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_NS_URI;
+					uriLiteral = UMLResource.STANDARD_PROFILE_NS_URI;
 				} else {
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + fragment;
+					uriLiteral = UMLResource.STANDARD_PROFILE_URI + fragment;
 				}
 			}
 		}
@@ -219,14 +206,12 @@
 	protected EPackage getPackageForURI(String uriString) {
 
 		if (XMI2UMLResource.STANDARD_L2_PROFILE_2_1_1_NS_URI.equals(uriString)
-			|| XMI2UMLResource.STANDARD_L2_PROFILE_2_1_NS_URI.equals(uriString)) {
-
-			uriString = UMLResource.STANDARD_L2_PROFILE_NS_URI;
-		} else if (XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_NS_URI
-			.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L2_PROFILE_2_1_NS_URI.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_NS_URI
+				.equals(uriString)
 			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_NS_URI.equals(uriString)) {
 
-			uriString = UMLResource.STANDARD_L3_PROFILE_NS_URI;
+			uriString = UMLResource.STANDARD_PROFILE_NS_URI;
 		}
 
 		return super.getPackageForURI(uriString);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI222UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI222UMLHandler.java
index 39fda77..ef7cd3d 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI222UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI222UMLHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012 CEA and others.
+ * Copyright (c) 2011, 2014 CEA and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   CEA - initial API and implementation
- *   Kenn Hussey (CEA) - 365027, 299527
+ *   Kenn Hussey (CEA) - 365027, 299527, 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
@@ -125,33 +125,20 @@
 					: uriLiteral.substring(index));
 			}
 		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_2_URI)) {
+			.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_2_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI)) {
 
 			int index = uriLiteral.indexOf('#');
 			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + "#_0"; //$NON-NLS-1$
+				uriLiteral = UMLResource.STANDARD_PROFILE_URI + "#_0"; //$NON-NLS-1$
 			} else {
 				String fragment = uriLiteral.substring(index);
 
 				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_NS_URI + "#/";
+					uriLiteral = UMLResource.STANDARD_PROFILE_NS_URI + "#/";
 				} else {
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + fragment;
-				}
-			}
-		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI)) {
-
-			int index = uriLiteral.indexOf('#');
-			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + "#_0"; //$NON-NLS-1$
-			} else {
-				String fragment = uriLiteral.substring(index);
-
-				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_NS_URI + "#/";
-				} else {
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + fragment;
+					uriLiteral = UMLResource.STANDARD_PROFILE_URI + fragment;
 				}
 			}
 		}
@@ -213,12 +200,10 @@
 	@Override
 	protected EPackage getPackageForURI(String uriString) {
 
-		if (XMI2UMLResource.STANDARD_L2_PROFILE_2_2_NS_URI.equals(uriString)) {
-			uriString = UMLResource.STANDARD_L2_PROFILE_NS_URI;
-		} else if (XMI2UMLResource.STANDARD_L3_PROFILE_2_2_NS_URI
-			.equals(uriString)) {
+		if (XMI2UMLResource.STANDARD_L2_PROFILE_2_2_NS_URI.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_2_NS_URI.equals(uriString)) {
 
-			uriString = UMLResource.STANDARD_L3_PROFILE_NS_URI;
+			uriString = UMLResource.STANDARD_PROFILE_NS_URI;
 		}
 
 		return super.getPackageForURI(uriString);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLHandler.java
new file mode 100644
index 0000000..c1d4f9a
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLHandler.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.EMOFExtendedMetaData;
+
+import org.eclipse.uml2.types.TypesPackage;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.resource.UMLResource;
+import org.eclipse.uml2.uml.resource.XMI2UMLResource;
+
+/**
+ * Handler that converts .xmi models.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0 
+ * 
+ * @since 5.0
+ */
+public class XMI242UMLHandler
+		extends UMLHandler {
+
+	protected static final String PRIMITIVE_TYPE_BOOLEAN = "Boolean"; //$NON-NLS-1$
+
+	protected static final String PRIMITIVE_TYPE_BOOLEAN_URI = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + '#' + PRIMITIVE_TYPE_BOOLEAN;
+
+	protected static final String PRIMITIVE_TYPE_INTEGER = "Integer"; //$NON-NLS-1$
+
+	protected static final String PRIMITIVE_TYPE_INTEGER_URI = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + '#' + PRIMITIVE_TYPE_INTEGER;
+
+	protected static final String PRIMITIVE_TYPE_REAL = "Real"; //$NON-NLS-1$
+
+	protected static final String PRIMITIVE_TYPE_REAL_URI = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + '#' + PRIMITIVE_TYPE_REAL;
+
+	protected static final String PRIMITIVE_TYPE_STRING = "String"; //$NON-NLS-1$
+
+	protected static final String PRIMITIVE_TYPE_STRING_URI = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + '#' + PRIMITIVE_TYPE_STRING;
+
+	protected static final String PRIMITIVE_TYPE_UNLIMITED_NATURAL = "UnlimitedNatural"; //$NON-NLS-1$
+
+	protected static final String PRIMITIVE_TYPE_UNLIMITED_NATURAL_URI = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + '#' + PRIMITIVE_TYPE_UNLIMITED_NATURAL;
+
+	protected static final String ECORE_EXTENSION_TYPE = "ecoreExtension"; //$NON-NLS-1$
+
+	protected static final String XMI_IDREF = "idref"; //$NON-NLS-1$
+
+	protected static final String IDREF_ATTRIB = XMIResource.XMI_NS + ':' + XMI_IDREF;
+
+	public XMI242UMLHandler(XMLResource xmiResource, XMLHelper helper, Map<?, ?> options) {
+		super(xmiResource, helper, options);
+	}
+
+	@Override
+	protected void handleProxy(InternalEObject proxy, String uriLiteral) {
+
+		if (uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_1_URI)
+			|| uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
+
+			int index = uriLiteral.indexOf('#');
+			uriLiteral = UMLResource.UML_METAMODEL_URI + (index == -1
+				? "#_0" //$NON-NLS-1$
+				: uriLiteral.substring(index));
+		} else if (uriLiteral
+			.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_1_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_1_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_URI)) {
+
+			int index = uriLiteral.indexOf('#');
+			if (index == -1) {
+				uriLiteral = UMLResource.STANDARD_PROFILE_URI + "#_0"; //$NON-NLS-1$
+			} else {
+				String fragment = uriLiteral.substring(index);
+
+				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
+					uriLiteral = UMLResource.STANDARD_PROFILE_NS_URI;
+				} else {
+					uriLiteral = UMLResource.STANDARD_PROFILE_URI + fragment;
+				}
+			}
+		} else if (uriLiteral
+			.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI)
+			|| uriLiteral
+				.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
+
+			int index = uriLiteral.indexOf('#');
+			uriLiteral = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI
+				+ (index == -1
+					? "#_0" //$NON-NLS-1$
+					: uriLiteral.substring(index));
+		}
+
+		super.handleProxy(proxy, uriLiteral);
+	}
+
+	@Override
+	protected void processElement(String name, String prefix, String localName) {
+
+		if (EMOFExtendedMetaData.EXTENSION.equals(localName)
+			&& (XMI2UMLResource.XMI_2_4_1_NS_URI.equals(helper.getURI(prefix)) || XMI2UMLResource.XMI_2_4_NS_URI
+				.equals(helper.getURI(prefix)))
+			&& attribs != null
+			&& EcorePackage.eNS_URI.equals(attribs
+				.getValue(EMOFExtendedMetaData.XMI_EXTENDER_ATTRIBUTE))) {
+
+			types.push(ECORE_EXTENSION_TYPE);
+		} else {
+			super.processElement(name, prefix, localName);
+		}
+	}
+
+	@Override
+	public void endElement(String uri, String localName, String name) {
+
+		if (types.peek() == ECORE_EXTENSION_TYPE) {
+			elements.pop();
+			types.pop();
+			helper.popContext();
+			mixedTargets.pop();
+		} else {
+			super.endElement(uri, localName, name);
+		}
+	}
+
+	@Override
+	protected void setAttribValue(EObject object, String name, String value) {
+
+		if (IDREF_ATTRIB.equals(name)
+			&& (!recordUnknownFeature || types.peek() != UNKNOWN_FEATURE_TYPE)) {
+
+			handleProxy((InternalEObject) object, '#' + value);
+		} else {
+			super.setAttribValue(object, name, value);
+		}
+	}
+
+	@Override
+	protected void setFeatureValue(EObject object, EStructuralFeature feature,
+			Object value, int position) {
+		
+		if (feature == UMLPackage.Literals.INSTANCE_SPECIFICATION__CLASSIFIER && object instanceof EnumerationLiteral) {
+			return;
+		}
+
+		super.setFeatureValue(object, feature, value, position);
+	}
+
+	@SuppressWarnings("deprecation")
+	@Override
+	protected EObject validateCreateObjectFromFactory(EFactory factory,
+			String typeName, EObject newObject, EStructuralFeature feature) {
+
+		if (newObject == null
+			&& feature == UMLPackage.Literals.TYPED_ELEMENT__TYPE) {
+
+			if (attribs != null) {
+
+				for (int i = 0, size = attribs.getLength(); i < size; ++i) {
+
+					if (attribs.getQName(i).equals(hrefAttribute)) {
+						String uriLiteral = attribs.getValue(i);
+
+						if (uriLiteral
+							.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI)
+							|| uriLiteral
+								.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
+
+							int index = uriLiteral.indexOf('#');
+
+							if (index != -1
+								&& TypesPackage.eINSTANCE
+									.getEClassifier(uriLiteral
+										.substring(index + 1)) instanceof EDataType) {
+								factory = UMLFactory.eINSTANCE;
+								newObject = createObjectFromFactory(factory,
+									UMLPackage.Literals.PRIMITIVE_TYPE
+										.getName());
+							}
+						} else if (uriLiteral
+								.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_1_URI)
+							|| uriLiteral
+								.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
+
+							int index = uriLiteral.indexOf('#');
+
+							if (index != -1
+								&& UMLPackage.eINSTANCE
+									.getEClassifier(uriLiteral
+										.substring(index + 1)) instanceof EClass) {
+								factory = UMLFactory.eINSTANCE;
+								newObject = createObjectFromFactory(factory,
+									UMLPackage.Literals.CLASS.getName());
+							}
+						}
+
+						break;
+					}
+				}
+			}
+		}
+
+		return super.validateCreateObjectFromFactory(factory, typeName,
+			newObject, feature);
+	}
+
+	@Override
+	protected EPackage getPackageForURI(String uriString) {
+
+		if (XMI2UMLResource.STANDARD_L2_PROFILE_2_4_1_NS_URI.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L2_PROFILE_2_4_NS_URI.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_1_NS_URI
+				.equals(uriString)
+			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_NS_URI.equals(uriString)) {
+
+			uriString = UMLResource.STANDARD_PROFILE_NS_URI;
+		}
+
+		return super.getPackageForURI(uriString);
+	}
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLLoadImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLLoadImpl.java
new file mode 100644
index 0000000..af44861
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLLoadImpl.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class XMI242UMLLoadImpl
+		extends UMLLoadImpl {
+
+	public XMI242UMLLoadImpl(XMLHelper helper) {
+		super(helper);
+	}
+
+	@Override
+	protected DefaultHandler makeDefaultHandler() {
+		return new XMI242UMLHandler(resource, helper, options);
+	}
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceFactoryImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceFactoryImpl.java
new file mode 100644
index 0000000..866953d
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceFactoryImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.uml2.uml.resource.CMOF2UMLResourceHandler;
+import org.eclipse.uml2.uml.resource.UML402UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.UML402UMLResourceHandler;
+import org.eclipse.uml2.uml.resource.XMI242UMLResource;
+import org.eclipse.uml2.uml.resource.XMI2UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.XMI2UMLResource;
+
+/**
+ * Resource factory that converts .xmi models.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0
+ * 
+ * @since 5.0
+ */
+public class XMI242UMLResourceFactoryImpl
+		extends UMLResourceFactoryImpl
+		implements XMI242UMLResource.Factory {
+
+	public XMI242UMLResourceFactoryImpl() {
+		super();
+	}
+
+	@Override
+	public Resource createResourceGen(URI uri) {
+		XMI242UMLResource result = new XMI242UMLResourceImpl(uri);
+		result.setEncoding(XMI2UMLResource.DEFAULT_ENCODING);
+		return result;
+	}
+
+	@Override
+	public Resource createResource(URI uri) {
+		XMI242UMLResource resource = (XMI242UMLResource) super
+			.createResource(uri);
+
+		ExtendedMetaData xmiExtendedMetaData = new XMI2UMLExtendedMetaData(
+			EPackage.Registry.INSTANCE);
+
+		Map<Object, Object> defaultSaveOptions = resource
+			.getDefaultSaveOptions();
+
+		defaultSaveOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
+			xmiExtendedMetaData);
+		defaultSaveOptions.put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
+			Boolean.TRUE);
+
+		ExtendedMetaData extendedMetaData = new UML402UMLExtendedMetaData(
+			EPackage.Registry.INSTANCE);
+
+		Map<Object, Object> defaultLoadOptions = resource
+			.getDefaultLoadOptions();
+
+		defaultLoadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA,
+			extendedMetaData);
+		defaultLoadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING,
+			Boolean.FALSE);
+		defaultLoadOptions.put(XMLResource.OPTION_RESOURCE_HANDLER,
+			new CMOF2UMLResourceHandler(new UML402UMLResourceHandler()));
+
+		return resource;
+	}
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceImpl.java
new file mode 100644
index 0000000..4c7fb6e
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI242UMLResourceImpl.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.internal.resource;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.eclipse.emf.ecore.xmi.XMLLoad;
+import org.eclipse.emf.ecore.xmi.XMLSave;
+import org.eclipse.uml2.uml.resource.XMI242UMLResource;
+
+/**
+ * Resource that converts .xmi models.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0
+ * 
+ * @since 5.0
+ */
+public class XMI242UMLResourceImpl
+		extends UMLResourceImpl
+		implements XMI242UMLResource {
+
+	public XMI242UMLResourceImpl(URI uri) {
+		super(uri);
+	}
+
+	@Override
+	protected XMLHelper createXMLHelper() {
+		return new XMI2UMLHelperImpl(this);
+	}
+
+	@Override
+	protected boolean assignIDsWhileLoading() {
+		return false;
+	}
+
+	@Override
+	protected XMLLoad createXMLLoad() {
+		return new XMI242UMLLoadImpl(createXMLHelper());
+	}
+
+	@Override
+	protected XMLSave createXMLSave() {
+		return new XMI2UMLSaveImpl(createXMLHelper());
+	}
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
index da29307..ac55794 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
@@ -71,52 +71,28 @@
 	@Override
 	protected void handleProxy(InternalEObject proxy, String uriLiteral) {
 
-		if (uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_URI)
-			|| uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_1_URI)
-			|| uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
+		if (uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_URI)) {
 
 			int index = uriLiteral.indexOf('#');
 			uriLiteral = UMLResource.UML_METAMODEL_URI + (index == -1
 				? "#_0" //$NON-NLS-1$
 				: uriLiteral.substring(index));
-		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_URI)
-			|| uriLiteral
-				.startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_URI)) {
+		} else if (uriLiteral.startsWith(XMI2UMLResource.STANDARD_PROFILE_URI)) {
 
 			int index = uriLiteral.indexOf('#');
 			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + "#_0"; //$NON-NLS-1$
+				uriLiteral = UMLResource.STANDARD_PROFILE_URI + "#_0"; //$NON-NLS-1$
 			} else {
 				String fragment = uriLiteral.substring(index);
 
 				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_NS_URI;
+					uriLiteral = UMLResource.STANDARD_PROFILE_NS_URI;
 				} else {
-					uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + fragment;
+					uriLiteral = UMLResource.STANDARD_PROFILE_URI + fragment;
 				}
 			}
 		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_URI)
-			|| uriLiteral
-				.startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_URI)) {
-
-			int index = uriLiteral.indexOf('#');
-			if (index == -1) {
-				uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + "#_0"; //$NON-NLS-1$
-			} else {
-				String fragment = uriLiteral.substring(index);
-
-				if ("#_yzU58YinEdqtvbnfB2L_5w".equals(fragment)) { //$NON-NLS-1$
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_NS_URI;
-				} else {
-					uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + fragment;
-				}
-			}
-		} else if (uriLiteral
-			.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)
-			|| uriLiteral
-				.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
+			.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
 
 			int index = uriLiteral.indexOf('#');
 			uriLiteral = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI
@@ -132,9 +108,7 @@
 	protected void processElement(String name, String prefix, String localName) {
 
 		if (EMOFExtendedMetaData.EXTENSION.equals(localName)
-			&& (XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix)) || XMI2UMLResource.XMI_2_4_1_NS_URI
-					.equals(helper.getURI(prefix)) || XMI2UMLResource.XMI_2_4_NS_URI
-				.equals(helper.getURI(prefix)))
+			&& (XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix)))
 			&& attribs != null
 			&& EcorePackage.eNS_URI.equals(attribs
 				.getValue(EMOFExtendedMetaData.XMI_EXTENDER_ATTRIBUTE))) {
@@ -173,8 +147,10 @@
 	@Override
 	protected void setFeatureValue(EObject object, EStructuralFeature feature,
 			Object value, int position) {
-		
-		if (feature == UMLPackage.Literals.INSTANCE_SPECIFICATION__CLASSIFIER && object instanceof EnumerationLiteral) {
+
+		if (feature == UMLPackage.Literals.INSTANCE_SPECIFICATION__CLASSIFIER
+			&& object instanceof EnumerationLiteral) {
+
 			return;
 		}
 
@@ -197,9 +173,7 @@
 						String uriLiteral = attribs.getValue(i);
 
 						if (uriLiteral
-							.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)
-							|| uriLiteral
-								.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
+							.startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
 
 							int index = uriLiteral.indexOf('#');
 
@@ -213,11 +187,7 @@
 										.getName());
 							}
 						} else if (uriLiteral
-							.startsWith(XMI2UMLResource.UML_METAMODEL_URI)
-							|| uriLiteral
-								.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_1_URI)
-							|| uriLiteral
-								.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
+							.startsWith(XMI2UMLResource.UML_METAMODEL_URI)) {
 
 							int index = uriLiteral.indexOf('#');
 
@@ -244,14 +214,8 @@
 	@Override
 	protected EPackage getPackageForURI(String uriString) {
 
-		if (XMI2UMLResource.STANDARD_L2_PROFILE_NS_URI.equals(uriString)
-			|| XMI2UMLResource.STANDARD_L2_PROFILE_2_4_NS_URI.equals(uriString)) {
-
-			uriString = UMLResource.STANDARD_L2_PROFILE_NS_URI;
-		} else if (XMI2UMLResource.STANDARD_L3_PROFILE_NS_URI.equals(uriString)
-			|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_NS_URI.equals(uriString)) {
-
-			uriString = UMLResource.STANDARD_L3_PROFILE_NS_URI;
+		if (XMI2UMLResource.STANDARD_PROFILE_NS_URI.equals(uriString)) {
+			uriString = UMLResource.STANDARD_PROFILE_NS_URI;
 		}
 
 		return super.getPackageForURI(uriString);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHelperImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHelperImpl.java
index 8fa1c01..ee5269c 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHelperImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHelperImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011 IBM Corporation, CEA, and others.
+ * Copyright (c) 2006, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039
+ *   Kenn Hussey (CEA) - 327039, 418466
  *
  */
 package org.eclipse.uml2.uml.internal.resource;
@@ -30,13 +30,14 @@
 		String href = super.getHREF(obj);
 
 		if (href.startsWith(UMLResource.UML_METAMODEL_URI)) {
-			href = XMI2UMLResource.UML_METAMODEL_URI + href.substring(href.indexOf('#'));
+			href = XMI2UMLResource.UML_METAMODEL_URI
+				+ href.substring(href.indexOf('#'));
 		} else if (href.startsWith(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
-			href = XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI + href.substring(href.indexOf('#'));
-		} else if (href.startsWith(UMLResource.STANDARD_L2_PROFILE_URI)) {
-			href = XMI2UMLResource.STANDARD_L2_PROFILE_URI + href.substring(href.indexOf('#'));
-		} else if (href.startsWith(UMLResource.STANDARD_L3_PROFILE_URI)) {
-			href = XMI2UMLResource.STANDARD_L3_PROFILE_URI + href.substring(href.indexOf('#'));
+			href = XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI
+				+ href.substring(href.indexOf('#'));
+		} else if (href.startsWith(UMLResource.STANDARD_PROFILE_URI)) {
+			href = XMI2UMLResource.STANDARD_PROFILE_URI
+				+ href.substring(href.indexOf('#'));
 		}
 
 		return href;
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLExtendedMetaData.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLExtendedMetaData.java
index 757d715..fdebf97 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLExtendedMetaData.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLExtendedMetaData.java
@@ -40,6 +40,9 @@
 			uriMap = new HashMap<URI, URI>();
 		}
 
+		// Standard.profile.uml -> Standard.profile.uml
+		uriMap.put(URI.createURI(UML212UMLResource.STANDARD_PROFILE_URI).appendFragment("_yzU58YinEdqtvbnfB2L_5w"), URI.createURI(UMLResource.STANDARD_PROFILE_NS_URI).appendFragment("/"));
+
 		return uriMap;
 	}
 
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
index 57ecf70..0407740 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013 IBM Corporation, CEA, and others.
+ * Copyright (c) 2008, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039, 351774, 405374
+ *   Kenn Hussey (CEA) - 327039, 351774, 405374, 418466
  *
  */
 package org.eclipse.uml2.uml.resource;
@@ -255,40 +255,16 @@
 			: null;
 	}
 
-	protected Profile getStandardL2Profile(Element element) {
-		return getProfile(element, UML212UMLResource.STANDARD_L2_PROFILE_URI);
-	}
-
-	protected Profile getStandardL3Profile(Element element) {
-		return getProfile(element, UML212UMLResource.STANDARD_L3_PROFILE_URI);
-	}
-
 	protected InternalEObject handleProxy(InternalEObject internalEObject) {
 
 		if (internalEObject != null && internalEObject.eIsProxy()) {
 			URI eProxyURI = internalEObject.eProxyURI();
 
-			Map<URI, URI> uriMap = UML22UMLExtendedMetaData.getURIMap();
+			Map<URI, URI> uriMap = UML212UMLExtendedMetaData.getURIMap();
 			URI uri = uriMap.get(eProxyURI);
 
 			if (uri != null) {
 				internalEObject.eSetProxyURI(uri);
-			} else {
-				uri = uriMap.get(
-					eProxyURI.trimFragment());
-				
-				if (uri != null) {
-					String eProxyURIFragment = eProxyURI.fragment();
-					String fragment = UML22UMLExtendedMetaData.getFragmentMap()
-							.get(eProxyURIFragment);
-
-						if (fragment != null) {
-							internalEObject.eSetProxyURI(uri.appendFragment(fragment));
-						}
-						else {
-							internalEObject.eSetProxyURI(uri.appendFragment(eProxyURIFragment));							
-						}
-				}
 			}
 		}
 
@@ -637,14 +613,6 @@
 					defaultCase(profileApplication);
 				}
 
-				Profile standardL3Profile = getStandardL3Profile(package_);
-
-				if (package_.isProfileApplied(getStandardL2Profile(package_))
-					&& !package_.isProfileApplied(standardL3Profile)) {
-
-					package_.applyProfile(standardL3Profile);
-				}
-
 				Object nsURI = UMLUtil.getTaggedValue(package_,
 					UMLUtil.PROFILE__ECORE + NamedElement.SEPARATOR
 						+ UMLUtil.STEREOTYPE__E_PACKAGE,
@@ -779,6 +747,6 @@
 			umlSwitch.doSwitch(resourceContents.get(i));
 		}
 		
-		((XMIResource)resource).setXMIVersion(xmiVersion);
+		((XMIResource) resource).setXMIVersion(xmiVersion);
 	}
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
index 95f8b12..f115702 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013 IBM Corporation, CEA, and others.
+ * Copyright (c) 2006, 2014 IBM Corporation, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   IBM - initial API and implementation
- *   Kenn Hussey (CEA) - 327039, 351774, 399544
+ *   Kenn Hussey (CEA) - 327039, 351774, 399544, 418466
  * 
  */
 package org.eclipse.uml2.uml.resource;
@@ -428,14 +428,6 @@
 			: null;
 	}
 
-	protected Profile getStandardL2Profile(Element element) {
-		return getProfile(element, UML22UMLResource.STANDARD_L2_PROFILE_URI);
-	}
-
-	protected Profile getStandardL3Profile(Element element) {
-		return getProfile(element, UML22UMLResource.STANDARD_L3_PROFILE_URI);
-	}
-
 	@Override
 	public void preLoad(XMLResource resource, InputStream inputStream,
 			Map<?, ?> options) {
@@ -448,6 +440,7 @@
 		final EList<EObject> resourceContents = resource.getContents();
 
 		final List<EAnnotation> annotationsToRemove = new ArrayList<EAnnotation>();
+		final List<ProfileApplication> profileApplicationsToRemove = new ArrayList<ProfileApplication>();
 
 		final List<org.eclipse.uml2.uml.Package> packagesRequiringStereotypes = new ArrayList<org.eclipse.uml2.uml.Package>();
 
@@ -484,8 +477,8 @@
 						"effect", true); //$NON-NLS-1$
 
 					if (value instanceof String) {
-						UMLUtil.setTaggedValue(action, getUML2Stereotype(
-							action, STEREOTYPE__ACTION),
+						UMLUtil.setTaggedValue(action,
+							getUML2Stereotype(action, STEREOTYPE__ACTION),
 							TAG_DEFINITION__EFFECT, value);
 					}
 				}
@@ -646,8 +639,9 @@
 			@Override
 			public Object caseCallBehaviorAction(
 					CallBehaviorAction callBehaviorAction) {
-				EObject eObject = getEObject(getExtension(resource,
-					callBehaviorAction), resource, "function", true); //$NON-NLS-1$
+				EObject eObject = getEObject(
+					getExtension(resource, callBehaviorAction), resource,
+					"function", true); //$NON-NLS-1$
 
 				if (eObject instanceof FunctionBehavior) {
 					callBehaviorAction.setBehavior((FunctionBehavior) eObject);
@@ -672,8 +666,8 @@
 						"bodyExpression", true); //$NON-NLS-1$
 
 					if (eObject instanceof StringExpression) {
-						UMLUtil.setTaggedValue(comment, getUML2Stereotype(
-							comment, STEREOTYPE__COMMENT),
+						UMLUtil.setTaggedValue(comment,
+							getUML2Stereotype(comment, STEREOTYPE__COMMENT),
 							TAG_DEFINITION__BODY_EXPRESSION, eObject);
 					}
 				}
@@ -687,8 +681,8 @@
 
 				if (extension != null) {
 					getValue(extension.getAnyAttribute(), "kind", true);
-				}	
-				
+				}
+
 				return super.caseConnector(connector);
 			}
 
@@ -884,16 +878,18 @@
 
 					if (eObject instanceof InputPin) {
 						InputPin inputValue = (InputPin) eObject;
-						
-						OpaqueAction argument = UMLFactory.eINSTANCE.createOpaqueAction();
+
+						OpaqueAction argument = UMLFactory.eINSTANCE
+							.createOpaqueAction();
 						argument.setName(inputValue.getName());
 						argument.getInputValues().add(inputValue);
-						
+
 						UMLUtil.setTaggedValue(
 							interactionUse,
 							getUML2Stereotype(interactionUse,
 								STEREOTYPE__INTERACTION_USE),
-							TAG_DEFINITION__ARGUMENT, Collections.singletonList(argument));
+							TAG_DEFINITION__ARGUMENT, Collections
+								.singletonList(argument));
 					}
 				}
 
@@ -1073,9 +1069,10 @@
 				AnyType extension = getExtension(resource, namedElement);
 
 				if (extension != null) {
-					getValue(extension.getAnyAttribute(), "clientDependency", true);
-				}	
-				
+					getValue(extension.getAnyAttribute(), "clientDependency",
+						true);
+				}
+
 				return super.caseNamedElement(namedElement);
 			}
 
@@ -1111,8 +1108,9 @@
 						Duration duration = (Duration) eObject;
 
 						ValuePin inputValue = (ValuePin) opaqueAction
-							.createInputValue(duration.getName(), duration
-								.getType(), UMLPackage.Literals.VALUE_PIN);
+							.createInputValue(duration.getName(),
+								duration.getType(),
+								UMLPackage.Literals.VALUE_PIN);
 
 						inputValue.setValue(duration);
 					}
@@ -1202,14 +1200,6 @@
 					defaultCase(profileApplication);
 				}
 
-				Profile standardL3Profile = getStandardL3Profile(package_);
-
-				if (package_.isProfileApplied(getStandardL2Profile(package_))
-					&& !package_.isProfileApplied(standardL3Profile)) {
-
-					package_.applyProfile(standardL3Profile);
-				}
-
 				Object nsURI = UMLUtil.getTaggedValue(package_,
 					UMLUtil.PROFILE__ECORE + NamedElement.SEPARATOR
 						+ UMLUtil.STEREOTYPE__E_PACKAGE,
@@ -1311,6 +1301,8 @@
 								.getEAnnotation(UMLUtil.UML2_UML_PACKAGE_2_0_NS_URI);
 
 							if (eAnnotation != null) {
+								EList<EObject> references = attributesAnnotation
+									.getReferences();
 								EList<EObject> contents = eAnnotation
 									.getContents();
 
@@ -1325,11 +1317,19 @@
 												.getValidJavaIdentifier(profileName)
 												+ '_' + version)) {
 
-										attributesAnnotation.getReferences()
-											.add(0, ePackage);
+										references.add(0, ePackage);
 										break;
 									}
 								}
+
+								if (references.isEmpty()) {
+									EPackage definition = appliedProfile
+										.getDefinition();
+
+									if (definition != null) {
+										references.add(definition);
+									}
+								}
 							}
 
 							org.eclipse.uml2.uml.Package applyingPackage = profileApplication
@@ -1342,6 +1342,13 @@
 								packagesRequiringStereotypes
 									.add(applyingPackage);
 							}
+
+							if (applyingPackage
+								.getProfileApplication(appliedProfile) != profileApplication) {
+
+								profileApplicationsToRemove
+									.add(profileApplication);
+							}
 						}
 					}
 
@@ -1515,7 +1522,7 @@
 							+ name.substring(5));
 					}
 				}
-				
+
 				AnyType extension = getExtension(resource, property);
 
 				if (extension != null) {
@@ -1523,8 +1530,10 @@
 					EObject ownedTemplateSignature = getEObject(extension,
 						resource, "ownedTemplateSignature", true); //$NON-NLS-1$
 
-					UMLUtil.setTaggedValue(property, getUML2Stereotype(
-						property, STEREOTYPE__TEMPLATEABLE_ELEMENT),
+					UMLUtil.setTaggedValue(
+						property,
+						getUML2Stereotype(property,
+							STEREOTYPE__TEMPLATEABLE_ELEMENT),
 						TAG_DEFINITION__OWNED_TEMPLATE_SIGNATURE,
 						ownedTemplateSignature);
 
@@ -1532,8 +1541,10 @@
 						extension, resource, "templateBinding", true); //$NON-NLS-1$
 
 					if (!templateBindings.isEmpty()) {
-						UMLUtil.setTaggedValue(property, getUML2Stereotype(
-							property, STEREOTYPE__TEMPLATEABLE_ELEMENT),
+						UMLUtil.setTaggedValue(
+							property,
+							getUML2Stereotype(property,
+								STEREOTYPE__TEMPLATEABLE_ELEMENT),
 							TAG_DEFINITION__TEMPLATE_BINDING, templateBindings);
 					}
 				}
@@ -1549,7 +1560,6 @@
 
 				return super.caseProperty(property);
 			}
-					
 
 			@Override
 			public Object caseRealization(Realization realization) {
@@ -1791,28 +1801,30 @@
 									"when", true); //$NON-NLS-1$
 
 								if (eObject instanceof ValueSpecification) {
-									
+
 									event = (TimeEvent) trigger
 										.getNearestPackage()
 										.createPackagedElement(
 											trigger.getName(),
 											UMLPackage.Literals.TIME_EVENT);
-																		
-									Object value = getValue(extension
-										.getAnyAttribute(), "isRelative", true); //$NON-NLS-1$
+
+									Object value = getValue(
+										extension.getAnyAttribute(),
+										"isRelative", true); //$NON-NLS-1$
 
 									if (value instanceof String) {
 										((TimeEvent) event)
 											.setIsRelative(Boolean.valueOf(
 												(String) value).booleanValue());
 									}
-									
+
 									if (eObject instanceof TimeExpression) {
 										((TimeEvent) event)
 											.setWhen((TimeExpression) eObject);
-										
+
 									} else {
-										UMLUtil.setTaggedValue(event,
+										UMLUtil.setTaggedValue(
+											event,
 											getUML2Stereotype(event,
 												STEREOTYPE__TIME_EVENT),
 											TAG_DEFINITION__WHEN,
@@ -1834,7 +1846,7 @@
 
 				return super.caseTrigger(trigger);
 			}
-			
+
 			@Override
 			public Object caseClassifierTemplateParameter(
 					ClassifierTemplateParameter classifierTemplateParameter) {
@@ -1852,7 +1864,8 @@
 							.setDefault((ParameterableElement) value);
 
 					} else {
-						UMLUtil.setTaggedValue(classifierTemplateParameter,
+						UMLUtil.setTaggedValue(
+							classifierTemplateParameter,
 							getUML2Stereotype(classifierTemplateParameter,
 								STEREOTYPE__CLASSIFIER_TEMPLATE_PARAMETER),
 							TAG_DEFINITION__DEFAULT_CLASSIFER, value);
@@ -1931,11 +1944,16 @@
 			eAnnotation.setEModelElement(null);
 		}
 
+		for (ProfileApplication profileApplication : profileApplicationsToRemove) {
+			profileApplication.getApplyingPackage().getProfileApplications()
+				.remove(profileApplication);
+		}
+
 		for (org.eclipse.uml2.uml.Package package_ : packagesRequiringStereotypes) {
 			ElementOperations.applyAllRequiredStereotypes(package_);
 		}
-		
-		((XMIResource)resource).setXMIVersion(xmiVersion);
+
+		((XMIResource) resource).setXMIVersion(xmiVersion);
 	}
 
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
index 2ef7153..fd432a5 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013 CEA and others.
+ * Copyright (c) 2011, 2014 CEA and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
  *
  * Contributors:
  *   CEA - initial API and implementation
- *   Kenn Hussey (CEA) - 351774, 405374
+ *   Kenn Hussey (CEA) - 351774, 405374, 418466
  *
  */
 package org.eclipse.uml2.uml.resource;
@@ -333,14 +333,6 @@
 			: null;
 	}
 
-	protected Profile getStandardL2Profile(Element element) {
-		return getProfile(element, UML302UMLResource.STANDARD_L2_PROFILE_URI);
-	}
-
-	protected Profile getStandardL3Profile(Element element) {
-		return getProfile(element, UML302UMLResource.STANDARD_L3_PROFILE_URI);
-	}
-
 	@Override
 	public void preLoad(XMLResource resource, InputStream inputStream,
 			Map<?, ?> options) {
@@ -635,14 +627,6 @@
 					defaultCase(profileApplication);
 				}
 
-				Profile standardL3Profile = getStandardL3Profile(package_);
-
-				if (package_.isProfileApplied(getStandardL2Profile(package_))
-					&& !package_.isProfileApplied(standardL3Profile)) {
-
-					package_.applyProfile(standardL3Profile);
-				}
-
 				Object nsURI = UMLUtil.getTaggedValue(package_,
 					UMLUtil.PROFILE__ECORE + NamedElement.SEPARATOR
 						+ UMLUtil.STEREOTYPE__E_PACKAGE,
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLExtendedMetaData.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLExtendedMetaData.java
new file mode 100644
index 0000000..eed23f4
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLExtendedMetaData.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.resource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+
+/**
+ * Extended meta-data required for model migration.
+ * OMG:  UML 2.4.x and UML 2.5 
+ * API:  UML2 4.x and UML2 5.0 
+ * 
+ * @since 5.0
+ */
+public class UML402UMLExtendedMetaData
+		extends BasicExtendedMetaData {
+
+	protected static Map<URI, URI> uriMap = null;
+
+	public static Map<URI, URI> getURIMap() {
+
+		if (uriMap == null) {
+			uriMap = new HashMap<URI, URI>();
+
+			// StandardL2.profile.uml -> Standard.profile.uml
+			uriMap.put(URI.createURI(UML402UMLResource.STANDARD_L2_PROFILE_URI), URI.createURI(UMLResource.STANDARD_PROFILE_URI));
+
+			// StandardL3.profile.uml -> Standard.profile.uml
+			uriMap.put(URI.createURI(UML402UMLResource.STANDARD_L3_PROFILE_URI), URI.createURI(UMLResource.STANDARD_PROFILE_URI));
+		}
+
+		return uriMap;
+	}
+
+	public UML402UMLExtendedMetaData(EPackage.Registry registry) {
+		super(registry);
+	}
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResource.java
new file mode 100644
index 0000000..7649724
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResource.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.resource;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.internal.resource.UML402UMLResourceFactoryImpl;
+
+/**
+ * UML resource required for model migration.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0
+ * 
+ * @since 5.0
+ */
+public interface UML402UMLResource
+		extends UMLResource {
+
+	public interface Factory
+			extends Resource.Factory {
+
+		public static final Factory INSTANCE = new UML402UMLResourceFactoryImpl();
+	}
+
+	String UML_METAMODEL_NS_URI = "http://www.eclipse.org/uml2/4.0.0/UML"; //$NON-NLS-1$
+
+	String STANDARD_L2_PROFILE_NS_URI = "http://www.eclipse.org/uml2/4.0.0/UML/Profile/L2"; //$NON-NLS-1$
+
+	String STANDARD_L2_PROFILE_URI = PROFILES_PATHMAP + "StandardL2." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
+
+	String STANDARD_L3_PROFILE_NS_URI = "http://www.eclipse.org/uml2/4.0.0/UML/Profile/L3"; //$NON-NLS-1$
+
+	String STANDARD_L3_PROFILE_URI = PROFILES_PATHMAP + "StandardL3." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResourceHandler.java
new file mode 100644
index 0000000..9a63c70
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML402UMLResourceHandler.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.resource;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.BasicResourceHandler;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.ProfileApplication;
+import org.eclipse.uml2.uml.util.UMLSwitch;
+
+/**
+ * Resource handler that converts .uml models.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0
+ * 
+ * @since 5.0
+ */
+public class UML402UMLResourceHandler
+		extends BasicResourceHandler {
+
+	protected boolean resolveProxies = true;
+
+	protected String xmiVersion = null;
+
+	@Override
+	public void preLoad(XMLResource resource, InputStream inputStream,
+			Map<?, ?> options) {
+		xmiVersion = ((XMIResource) resource).getXMIVersion();
+	}
+
+	protected InternalEObject handleProxy(InternalEObject internalEObject) {
+
+		if (internalEObject != null && internalEObject.eIsProxy()) {
+			URI eProxyURI = internalEObject.eProxyURI();
+
+			Map<URI, URI> uriMap = UML402UMLExtendedMetaData.getURIMap();
+			URI uri = uriMap.get(eProxyURI);
+
+			if (uri != null) {
+				internalEObject.eSetProxyURI(uri);
+			}
+		}
+
+		return internalEObject;
+	}
+
+	@Override
+	public void postLoad(final XMLResource resource, InputStream inputStream,
+			Map<?, ?> options) {
+		final EList<EObject> resourceContents = resource.getContents();
+
+		final List<ProfileApplication> profileApplicationsToRemove = new ArrayList<ProfileApplication>();
+
+		UMLSwitch<Object> umlSwitch = new UMLSwitch<Object>() {
+
+			@Override
+			public Object caseProfileApplication(
+					ProfileApplication profileApplication) {
+				Profile appliedProfile = profileApplication.getAppliedProfile();
+
+				if (appliedProfile != null) {
+					org.eclipse.uml2.uml.Package applyingPackage = profileApplication
+						.getApplyingPackage();
+
+					if (applyingPackage != null
+						&& applyingPackage
+							.getProfileApplication(appliedProfile) != profileApplication) {
+						profileApplicationsToRemove.add(profileApplication);
+					}
+				}
+
+				return super.caseProfileApplication(profileApplication);
+			}
+
+			@Override
+			public Object defaultCase(EObject eObject) {
+
+				for (EReference eReference : eObject.eClass()
+					.getEAllReferences()) {
+
+					if (!eReference.isDerived() && !eReference.isContainer()
+						&& !eReference.isContainment()
+						&& eObject.eIsSet(eReference)) {
+
+						if (eReference.isMany()) {
+							@SuppressWarnings("unchecked")
+							InternalEList<InternalEObject> values = (InternalEList<InternalEObject>) eObject
+								.eGet(eReference);
+
+							for (InternalEObject value : values) {
+								handleProxy(value);
+							}
+						} else {
+							handleProxy((InternalEObject) eObject.eGet(
+								eReference, false));
+						}
+					}
+				}
+
+				Iterator<?> contents = resolveProxies
+					? eObject.eContents().iterator()
+					: ((InternalEList<?>) eObject.eContents()).basicIterator();
+
+				if (contents != null) {
+
+					while (contents.hasNext()) {
+						doSwitch((EObject) contents.next());
+					}
+				}
+
+				return eObject;
+			}
+		};
+
+		for (int i = 0; i < resourceContents.size(); i++) {
+			umlSwitch.doSwitch(resourceContents.get(i));
+		}
+
+		for (ProfileApplication profileApplication : profileApplicationsToRemove) {
+			profileApplication.getApplyingPackage().getProfileApplications()
+				.remove(profileApplication);
+		}
+
+		((XMIResource) resource).setXMIVersion(xmiVersion);
+	}
+
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UMLResource.java
index dba76f1..5a87f1a 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UMLResource.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UMLResource.java
@@ -89,14 +89,6 @@
 
 	String ECORE_PROFILE_URI = PROFILES_PATHMAP + "Ecore." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
 
-	String STANDARD_L2_PROFILE_NS_URI = "http://www.eclipse.org/uml2/4.0.0/UML/Profile/L2"; //$NON-NLS-1$
-
-	String STANDARD_L2_PROFILE_URI = PROFILES_PATHMAP + "StandardL2." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
-
-	String STANDARD_L3_PROFILE_NS_URI = "http://www.eclipse.org/uml2/4.0.0/UML/Profile/L3"; //$NON-NLS-1$
-
-	String STANDARD_L3_PROFILE_URI = PROFILES_PATHMAP + "StandardL3." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
-
 	String STANDARD_PROFILE_NS_URI = "http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard"; //$NON-NLS-1$
 
 	String STANDARD_PROFILE_URI = PROFILES_PATHMAP + "Standard." + PROFILE_FILE_EXTENSION; //$NON-NLS-1$
@@ -111,7 +103,7 @@
 
 	String UML_5_0_0_CONTENT_TYPE_IDENTIFIER = "org.eclipse.uml2.uml_5_0_0"; //$NON-NLS-1$
 
-	String UML_CONTENT_TYPE_IDENTIFIER = UML_4_0_0_CONTENT_TYPE_IDENTIFIER;
+	String UML_CONTENT_TYPE_IDENTIFIER = UML_5_0_0_CONTENT_TYPE_IDENTIFIER;
 
 	String UML2_PROFILE_NS_URI = "http://www.eclipse.org/uml2/schemas/UML2/2"; //$NON-NLS-1$
 
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI242UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI242UMLResource.java
new file mode 100644
index 0000000..c8bd9f2
--- /dev/null
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI242UMLResource.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014 CEA and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   CEA - initial API and implementation
+ *
+ */
+package org.eclipse.uml2.uml.resource;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.internal.resource.XMI242UMLResourceFactoryImpl;
+
+/**
+ * XMI resource required for model migration.
+ * OMG:  UML 2.4.x and UML 2.5
+ * API:  UML2 4.x and UML2 5.0 
+ * 
+ * @since 5.0
+ */
+public interface XMI242UMLResource
+		extends XMI2UMLResource {
+
+	public interface Factory
+			extends Resource.Factory {
+
+		public static final Factory INSTANCE = new XMI242UMLResourceFactoryImpl();
+	}
+}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
index 484a0fe..e202499 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
@@ -31,38 +31,43 @@
 		if (uriMap == null) {
 			uriMap = new HashMap<URI, URI>();
 
-			uriMap.put(URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_URI),
-				URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
-			uriMap.put(URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_URI),
-				URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+			uriMap.put(URI.createURI(XMI2UMLResource.STANDARD_PROFILE_URI),
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
+
+			uriMap.put(
+				URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_1_URI),
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
+			uriMap.put(
+				URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_1_URI),
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_URI),
-				URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_URI),
-				URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI),
-				URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_2_URI),
-				URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_URI),
-				URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_1_1_URI),
-				URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_1_URI),
-				URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 			uriMap.put(
 				URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_1_URI),
-				URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+				URI.createURI(UMLResource.STANDARD_PROFILE_URI));
 		}
 
 		return uriMap;
@@ -80,11 +85,9 @@
 		}
 
 		String namespace = super.getNamespace(ePackage);
-		return UMLResource.STANDARD_L2_PROFILE_NS_URI.equals(namespace)
-			? XMI2UMLResource.STANDARD_L2_PROFILE_NS_URI
-			: (UMLResource.STANDARD_L3_PROFILE_NS_URI.equals(namespace)
-				? XMI2UMLResource.STANDARD_L3_PROFILE_NS_URI
-				: namespace);
+		return UMLResource.STANDARD_PROFILE_NS_URI.equals(namespace)
+			? XMI2UMLResource.STANDARD_PROFILE_NS_URI
+			: namespace;
 	}
 
 	@Override
@@ -97,8 +100,10 @@
 			|| XMI2UMLResource.UML_METAMODEL_2_1_1_NS_URI.equals(namespace)
 			|| XMI2UMLResource.UML_METAMODEL_2_1_NS_URI.equals(namespace)
 			? UMLPackage.eINSTANCE
-			: super.getPackage(XMI2UMLResource.STANDARD_L2_PROFILE_NS_URI
+			: super.getPackage(XMI2UMLResource.STANDARD_PROFILE_NS_URI
 				.equals(namespace)
+				|| XMI2UMLResource.STANDARD_L2_PROFILE_2_4_1_NS_URI
+					.equals(namespace)
 				|| XMI2UMLResource.STANDARD_L2_PROFILE_2_4_NS_URI
 					.equals(namespace)
 				|| XMI2UMLResource.STANDARD_L2_PROFILE_2_2_NS_URI
@@ -107,18 +112,18 @@
 					.equals(namespace)
 				|| XMI2UMLResource.STANDARD_L2_PROFILE_2_1_NS_URI
 					.equals(namespace)
-				? UMLResource.STANDARD_L2_PROFILE_NS_URI
-				: (XMI2UMLResource.STANDARD_L3_PROFILE_NS_URI.equals(namespace)
-					|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_NS_URI
-						.equals(namespace)
-					|| XMI2UMLResource.STANDARD_L3_PROFILE_2_2_NS_URI
-						.equals(namespace)
-					|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_NS_URI
-						.equals(namespace)
-					|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_NS_URI
-						.equals(namespace)
-					? UMLResource.STANDARD_L3_PROFILE_NS_URI
-					: namespace));
+				|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_1_NS_URI
+					.equals(namespace)
+				|| XMI2UMLResource.STANDARD_L3_PROFILE_2_4_NS_URI
+					.equals(namespace)
+				|| XMI2UMLResource.STANDARD_L3_PROFILE_2_2_NS_URI
+					.equals(namespace)
+				|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_NS_URI
+					.equals(namespace)
+				|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_NS_URI
+					.equals(namespace)
+				? UMLResource.STANDARD_PROFILE_NS_URI
+				: namespace);
 	}
 
 }
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
index 8ecd012..d26ea1e 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
@@ -114,14 +114,6 @@
 
 	String UML_PRIMITIVE_TYPES_LIBRARY_2_5_URI = "http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi"; //$NON-NLS-1$
 
-	String STANDARD_L2_PROFILE_NS_URI = STANDARD_L2_PROFILE_2_4_1_NS_URI;
-
-	String STANDARD_L2_PROFILE_URI = STANDARD_L2_PROFILE_2_4_1_URI;
-
-	String STANDARD_L3_PROFILE_NS_URI = STANDARD_L3_PROFILE_2_4_1_NS_URI;
-
-	String STANDARD_L3_PROFILE_URI = STANDARD_L3_PROFILE_2_4_1_URI;
-
 	String STANDARD_PROFILE_NS_URI = STANDARD_PROFILE_2_5_NS_URI;
 
 	String STANDARD_PROFILE_URI = STANDARD_PROFILE_2_5_URI;
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
index 7385896..ddbd7e0 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
@@ -137,9 +137,12 @@
 import org.eclipse.uml2.uml.resource.UML22UMLResource;
 import org.eclipse.uml2.uml.resource.UML302UMLExtendedMetaData;
 import org.eclipse.uml2.uml.resource.UML302UMLResource;
+import org.eclipse.uml2.uml.resource.UML402UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.UML402UMLResource;
 import org.eclipse.uml2.uml.resource.UMLResource;
 import org.eclipse.uml2.uml.resource.XMI212UMLResource;
 import org.eclipse.uml2.uml.resource.XMI222UMLResource;
+import org.eclipse.uml2.uml.resource.XMI242UMLResource;
 import org.eclipse.uml2.uml.resource.XMI2UMLExtendedMetaData;
 import org.eclipse.uml2.uml.resource.XMI2UMLResource;
 
@@ -12825,8 +12828,8 @@
 				.getResourceFactoryRegistry().getContentTypeToFactoryMap();
 
 			contentTypeToFactoryMap.put(
-				UMLResource.UML_4_0_0_CONTENT_TYPE_IDENTIFIER,
-				UMLResource.Factory.INSTANCE);
+				UML402UMLResource.UML_4_0_0_CONTENT_TYPE_IDENTIFIER,
+				UML402UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
 				UML302UMLResource.UML_3_0_0_CONTENT_TYPE_IDENTIFIER,
 				UML302UMLResource.Factory.INSTANCE);
@@ -12834,17 +12837,20 @@
 				UML212UMLResource.UML_2_1_0_CONTENT_TYPE_IDENTIFIER,
 				UML212UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
+				UML212UMLResource.UML_2_0_0_CONTENT_TYPE_IDENTIFIER,
+				UML212UMLResource.Factory.INSTANCE);
+			contentTypeToFactoryMap.put(
 				UML22UMLResource.UML2_CONTENT_TYPE_IDENTIFIER,
 				UML22UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
 				XMI2UMLResource.UML_CONTENT_TYPE_IDENTIFIER,
 				XMI2UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
-				XMI2UMLResource.UML_2_4_1_CONTENT_TYPE_IDENTIFIER,
-				XMI2UMLResource.Factory.INSTANCE);
+				XMI242UMLResource.UML_2_4_1_CONTENT_TYPE_IDENTIFIER,
+				XMI242UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
-				XMI2UMLResource.UML_2_4_CONTENT_TYPE_IDENTIFIER,
-				XMI2UMLResource.Factory.INSTANCE);
+				XMI242UMLResource.UML_2_4_CONTENT_TYPE_IDENTIFIER,
+				XMI242UMLResource.Factory.INSTANCE);
 			contentTypeToFactoryMap.put(
 				XMI222UMLResource.UML_2_2_CONTENT_TYPE_IDENTIFIER,
 				XMI222UMLResource.Factory.INSTANCE);
@@ -12866,6 +12872,7 @@
 
 			Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
 
+			uriMap.putAll(UML402UMLExtendedMetaData.getURIMap());
 			uriMap.putAll(UML302UMLExtendedMetaData.getURIMap());
 			uriMap.putAll(UML212UMLExtendedMetaData.getURIMap());
 			uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());