Eclipse Galileo is out a while and it ships with TMF XText 0.7 (formerly openArchitectureWare XText). Amongst other things it contains scoping of references, which I really like and especially the ability to serialize your model back to its text representation without comments being lost.
This is especially convenient if you are currently using some other means of generating code, for example hibernate tools. The serialization feature gives you an easy possibility to transform your existing model to an xtext model from within java code. Even better create updatable models, where you can manually edit the Xtext representation and keep the model up to date from an external source.
Example for loading and saving an XText model:
public static void main(String[] args) {
DomainModelStandaloneSetup.doSetup();
ResourceSet resourceSet = new ResourceSetImpl();
URI uri = URI.createFileURI("myapplication.domainmodel");
Resource resource = resourceSet.getResource(uri, true);
Model model = (Model) resource.getContents().get(0);
Entity entity = DomainModelFactory.eINSTANCE.createEntity();
entity.setName("Customer");
model.getElements().add(entity);
HashMap saveOptions = new HashMap();
saveOptions.put(XtextResource.OPTION_FORMAT, Boolean.TRUE);
resource.save(new FileOutputStream("myapplication.domainmodel"), saveOptions);
}
The classes in bold face are generated from your Xtext grammar.