title: EMF generate model class from ECore XMI at runtime
body: <p>As I know, we can generate ECore model like this:</p>
  
  <pre><code>// 动态创建一个Book的子类，Magic power comes from here
          // create the SchoolBook EClass
          EClass schoolBookEClass = efactory.createEClass();
          schoolBookEClass.setName("SchoolBook");
  
          // create a new attribute for this EClass
          EAttribute level = efactory.createEAttribute();
          level.setName("level");
          level.setEType(epackage.getEInt());
          schoolBookEClass.getEStructuralFeatures().add(level);
  
          // 设置父类
          schoolBookEClass.getESuperTypes().add(ExtlibraryPackage.eINSTANCE.getBook());
  
          // 创建新的课程类
          EClass courseEClass = efactory.createEClass();
          courseEClass.setName("Course");
  
          // 课程名称属性
          EAttribute courseName = efactory.createEAttribute();
          courseName.setName("courseName");
          courseName.setEType(epackage.getEString());
          courseEClass.getEStructuralFeatures().add(courseName);
  
          // 课程对教材的引用关系
          EReference courseBook = efactory.createEReference();
          courseBook.setName("courseBook");
          courseBook.setEType(schoolBookEClass);
          courseBook.setContainment(false);
          courseEClass.getEStructuralFeatures().add(courseBook);
  
          // 创建包
          EPackage schoolPackage = efactory.createEPackage();
          schoolPackage.setName("elv");
          schoolPackage.setNsPrefix("elv");
          schoolPackage.setNsURI("http:///www.elver.org/School");
          schoolPackage.getEClassifiers().add(courseEClass);
          schoolPackage.getEClassifiers().add(schoolBookEClass);
          EPackage.Registry.INSTANCE.put(schoolPackage.getNsURI(), schoolPackage);
  </code></pre>
  
  <p>there is no such classes in classpath at all, but we can use them for other operation, create ui, save to database for example.</p>
  
  <p>If I have some EMF model classes defined in a xml file (mymodel.ecore for example), which just contains the XMI serialization of those ECore model. Then how can I create instance of them at runtime without generated classes on classpath.</p>