I'm not sure how repairable the H4n is, unless you're a total DIY get-your-hands-dirty sort of person who deal with electronic tech - the H4n, like some other handheld recorders in this price range seem to be designed as thrwaways. In that it the production/repair/servicing costs far outweigh the manufacturing of the new one all together (in all fairness, I own an H4n too, so I'm not speaking down to you when I say this opinion - it's just that handhelds like the H-series Zoom recorders or the Olympus LS10 et al are on a different plane of existence than say an R4, FR2, or 702+ - and the build quality and limited support by the manufacturers of such handheld units seem to sway my thoughts toward the direction of them being considered "throwaways' by the companies themselves). To put this into perspective, Rode considers(ed) the $500 NT4 a throwaway mic when I sent it in because of P48 problems - they literally tossed it out, with no troubleshooting report, and sent a brand new one to replace it.
So it's possible that Samson would just send you a brand new H4n to replace the defective one like Rode did with me, however you said "over the years" so I safely assume you're out of a warranty on that since 1-2 years is usually the max offered. In that case, contacting them might not be fruitful at all, unless they want you to pay a lot out of warranty (thus backing of the "throwaway" idea, where the repair costs more than it would to get a brand new one).
If what you asking is who to take it to (besides Samson since it's likely out of warranty), or what sort of formal documentation is online there about the inner workings of the H4n and fixing it, I honestly do not know - this is where, if you're a total DIY type person, you may have some trail and error luck by digging inside the unit and trying to replace or solder anything that came loose.
The next best option I can think of, short of cracking it out, is to try filling in the gap between the XLRs and chassis with something like Gorilla Glue, assuming the wiggle-room gap isn't large enough that it would just pour inside. That's the best thing I can think of.
Good luck, hope you find a solution that works!