Hi Ian,
If you defined your meta-model in KM3 then you can define elements to be
ordered. I don't use KM3 but there if details of how to do this on the old
yahoo newsgroup.
1) I use ECore to define all my meta-models and don't think it is possible
to guarantee the order of the output of the transformation. You can of
course order the source elements before the transformation, assuming the
source element has a useful attribute upon which the sort can be performed
on. For example I have an order attribute on some of my source model
elements, so I order the source collection ( ->sortedBy(e|e.order) ) and
then transform them.
2) You can perform a for loop over the sorted collection and access each
of the sorted elements appropriately.