Does charging to 100% damage an iPhone battery I have an XR and as I am indoors a lot of the time, my phone does spend a few hours charging at 100% (although I unplug at night).  It's rare that I let the phone run past 80% and even rare that it goes past 60%.

Is this likely to damage the battery?

This Macworld article says isn't optimal, although it won't necessarily damage your battery. However, I've seen other people stating that charging to 100% is very damaging which is why Ios 13 will have measures to prevent it. Further still, I've seen articles state that iOS 12 already is designed to cope with charging at 100%, and the iOS 13 improvements are more to do with overnight charging. 

What's the correct answer?
Also, as should I shut down the phone at night if it is not charging?
No it doesn’t. Any 2018 or newer hardware and iOS can handle kiosk mode / constantly charged batteries much better than the old controllers so you should just keep it charged if you like that.
Your XR can be kept 100% topped off without any long term harm.
I disagree with Mac World and only think you should shut down the phone if you don’t regularly do that from time to time (you should do that weekly IMO) and it’s no problem to connect to charge and then power it off. The charging runs without the OS but there’s no benefit to being off while charging in all but some weird edge cases (where the software is so broken it’s running CPU constantly).
Also - some older questions here have old advice for the previous design, when this was in fact a problem if you didn’t care about having a fully charged battery and only cared about years and years between the battery being consumed.

What are the best practices for battery longevity?
Is charging my iPhone all night harmful?

Those above questions should probable be locked as “historical” and not used for the iPhone X and newer and corresponding new MacBook / iPad / Apple Watch and more smartly engineered devices that preserve the battery longevity much better than could be accomplished in the past.