'How can I transform the xtext DSL elements into XML?
I have created a grammar using xtext, and generated the DSL. Now, I want to transform the DSL elements (program that is conforming to the grammar) to XML elements. So, I am wondering if there is a framework that allows to do that using Java for example. I could open the files having the extension of the DSL using the eclipse editor "Sample Reflective Ecore Model Editor" and could visualize the elements of the DSL.

Solution 1:[1]
Do you mean a transformation to the Capella Model? Then I would suggest not the XML, but bundle the Capella EMF model with your Xtext RCP and do a model-to-model transformation based on EMF (I would suggest Xtend, but QVT, Acceleo etc. can be used, too)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andreas Graf |
