Is that still the case? They were switching over to the fleet-up of XO to CO that we do in squadrons last I heard.
DH: 1st tours are all LTs. Some 2nd tour jobs are O-4 spot promote, and for those that aren't, most people are either selected or wearing LCDR in their 2nd DH tour. So the type of command matters: of the 5 SWO DHs on a DDG, probably only one will be an O-4. On a CG, most are O-4.
XO: You're right, we've been doing fleet-up for 5ish years now, so on the vast majority of ships the XO is the same rank as the CO. They couldn't make fleet-up work on CGs, not enough real estate for the ego of two SWO CAPTs. So for a while they were detailing non-command screened O-5s on a twilight tour, had some issues there too, you can read about it in Navy Times. So now the CG XO is a hot-running (command-screened) O-4, who then goes on to DDG command.