If you can swap two elements, you can swap infinite elements.
All you need to do is pair-wise sort your elements in an iterative fashion.
So, for an array of elements e0 -> en, do pairwise comparisons of (e0,e1), (e1,e2) etc until you've reached the last element.
Do mind: if a swap is successful, you need to compare the swapped element to the one BEFORE that. Don't forget to take a step back!