Not very specific but I think the logic should go something like this;
1) Get coordinates of object 1 and save as value
2) Get coordinates of object 2 and save as value
3) Destroy object 1
4) Create new object 1 in object 2 coordinates
5) Destroy object 2
6) Create new object 2 in coordinates of object 2