SI-7074 Fix xml attribute sorting

Sorting the attributes of an xml element could drop some of the
attributes. It was caused by the incorrect use of MetaData#copy() to
concatenate "smaller" with the rest of the attributes. The
MetaData#copy() method is similar to the following hypothetical method
on a List:

def copy(other: List): List = head :: other

The fix prepends all elements of "smaller" to the rest of the attributes
in the proper order.
Merge pull request #2149 from khernyo/issue/7074

SI-7074 Fix xml attribute sorting