I really didn't expect it to work at all, but it does kind of work, albeit naively and only in the case that there are zero validation problems with the generated model item (Collection).
Now the problem is that when there is a problem validating the manufactured collection the following exception is thrown (as I really expected).
java.lang.IllegalArgumentException: You can only add issues for EObjects contained in the currently validated resource 'platform:/resource/TestProj/attributetest/test.attributes'. But the given EObject was contained in 'null'
Now, obviously, creating an EObject is not just as simple as creating an object then setting the values. I also need to set at minimum some kind of eResource and possibly some other fields.
In this example, the created Collection object corresponds to a folder in the workspace. I'd like to be able to create this Collection and be able to show a validation problem without XText crashing.