I'm much older than that and haven't had my hips replaced, although I was advised to when I was around 50. As it turned out, the problem wasn't actually with my hip joint, but with calcification of soft tissue around the joint. I do know of one person who needed hip joint replacements in her thirties, but I believe, if I remember correctly, the doctors advised against it because of her age. Let me see if I can find out more from her.
Make sure your doctor has experience with XLH, and perhaps consider getting a second opinion. Doctors who haven't dealt with XLH patients before are often surprised by what they find once they cut us open, and that's never good!
Also, I'm not sure if you know, but it's generally recommended that you should be on treatment (either phosphorus and calcitriol supplements or burosumab, and, personally, I'd want to be on burosumab, since it does demonstrably better at healing bones) for several months before surgery, as well as during the healing period.
I'm hoping that when the natural history study (a collaboration among the Network, Ultragenyx and Yale) launches, we'll start to get more data on when patients are getting joint replacements. The last I knew, asking about that was in the study. We know joints are being replaced earlier than the general population, but we don't know exactly how early.