In short, yes, it can be done with a replacement barrel and mag. But, there is a difference in the extractors between the two, which may or may not cause reliability issues. The slide on the 10mm Glock is a little heavier in weight, and the recoil spring a little stronger as well, something to consider if you shoot a lot of full power loads.
Larry