How to hash a set of elements Imagine the following senario. We have $n$ participants. Participant $i$ has a set of elements $S_i$ with the elements being in a random order, possibly different for each participant. 

The participants want some way to get something like a "hash" of the sets. Particularly they want for the hash to be collision resistant, so that it is hard to find two different sets with the same hash.

The hash function should also be pre-image attack resistant, so that given a hash (or a set) it is hard to find a (another) set that hashes to this values.

The catch is that the participants cannot reorder their sets. This means that the hash function must be order independant of the order of the elements but not of their contents.

Is there a secure and solid way to fulfil the requirements?

( I had a simple idea, to compute something like $SetHash(S) = Hash(e_1) \oplus Hash(e_2) \oplus \dots \oplus Hash(e_n)$ which i think satisfies the preimage attack resistance property but i cant formally prove that it is also collision resistant)
The basic problem seems to be that of canonicalization. If you can't reorder the set, then you will have to choose a commutative, associative, operator to concatenate the values; $a \otimes b = b \otimes a$ and also $a \otimes (b \otimes c) = (a \otimes b) \otimes c$

An immediate candidate for this would be to interpret the elements, $m_i$ as integers and let $\otimes$ be integer multiplication. You could then pass it through a secure hash function $H(\prod m_i)$ to get your final hash.

To improve the collision resistance with this choice of $\otimes$ operation (unfortunately $H(5 \times 4) = H(10 \times 2)$; different sets with the same hash) you might consider associating each message with a unique prime number, and by the fundamental theorem of arithmetic, this product will be unique.