I did a repair on a friends 5'ver a number of years back. He had a 10 gallon tank that died in a CG we were both staying in. He bought a new unit at the local RV place and I swapped it out for him.
The tank itself was ok, so I kept it, thinking I would repair it an swap mine out, going from 6 to 10. I wish it was that easy.
As mentioned, physical size difference.
For obvious reasons, the 10 is bigger. It requires a bigger opening to fit in. This requires surgery on the wall of the RV to provide solid framing all around to screw the unit in.
On mine, I didn't have enough extra width and height to make it an easy conversion. I would have had to carve up a partition, do cosmetic repairs and more, so I scrapoed the idea.
However, if you have enough extra width and height inside, and you're willing to enlarge the opening of the outside wall, yes it is doable.