title: Create and modify ecore files and their instances from code
body: <p>My question has two parts:</p>
  
  <blockquote>
    <p>1) How can I create and/or modify and then store EMF ecore files (ecore metamodels with .ecore suffixes) from my scala/java code?</p>
    
    <p>2) How can I create and/or modify an instance of an ecore file (i.e. a model conforming to an ecore metamodel) from my scala/java code?</p>
  </blockquote>
  
  <p>I am looking to see if there are some possible ways of doing these, other that manipulating directly their corresponding XML files using XML API's.</p>
  
  <p>Providing a code spinet or a reference to it is very much appreciated. </p>
  
  <p><strong>ps.</strong> As a background thought, I am wondering if I can use a single API for performing both of the above tasks, as we can look to an ecore file as a model/instance of Ecore.ecore.</p>