from what I can see in your example you are taking a uml model containing
classes as input and then you want to create instances of the classes.

In your out model example I can not see any uml.Model/uml.Package etc.

You will have to investigate the uml metamodel to see how
uml.InstanceSpecifications are stored. You need to contain them, similar to
for example uml.Properties that are contained by a class.
aClass.ownedAttributes.

A good start is to manually create an example model in uml (e.g. use the
tree editor) with similar structure as your output, then it will be easier
to see what you need to create and how the structure should be to make the
model "valid".