Take em out and put into a bucket with tank water and move to your workspace. Do the work, exposing them to air is fine, try to be quick tho. Then put them right back in the tank.
Or just pull the top one out, add glue gel to it and stick it where it needs to go in the tank.
You can also use aquarium epoxy or even plumbers epoxy as long as it is safe for potable water lines. Although it is kinda ugly, if it's between rocks you should be fine. I fine the epoxy bond is weaker than the rocks so they can be separated if you want. It might make your skimmer go nuts tho.