I had a small problem saving my EMF model to XML. I got the error message “The object … is not contained in a resource”.
The solution is simple. In the EMF editor just set containment to true for the reference:
Done! After that, the object was saved correctly in the XML file.