TheWith a strict reading, the optional rule from Xanathar's won't let you choose the order
This rule states:
In rare cases, effects can happen at the same time, especially at the start or end of a creature's turn. If two or more things happen at the same time on a character or monster's turn, the person at the game table - whether player or DM - who controls that creature decides the order in which those things happen.
This optional rule only applies when things happen at the same time on a character or monster's turn. So strictly reading it, this can't be applied at all because there are no turns when short resting. Thus there is no rule (optional or otherwise) about ordering these events.
It is up to the GM how these are ordered
However, the events of "Spending Hit Dice" and "Attuning" are certainly both happening at the same time (they are both triggered "at the end of a short rest"). Maybe your GM will allow you to determine the order, maybe they won't. Lacking any rules, it is up to them to decide. The GM may even allow the Xanathar's rule to apply during short rests; it's already an optional rule after all and whether it should only apply during combat is a different question entirely.