There's no guarantee the Switch will sell more software than the Xbox One. The Switch won't have anywhere close the same attach rates as the Xbox, which has the best attach rates of any consoles other than PlayStation. Handhelds don't in general. Look at the Gameboy at 118 million hardware units, it sold 501 million software. The NES also sold 501 million software, but inside 61 million hardware units. It had nearly double the attach rate.
The Xbox will sell 500 million physical units in the end probably. The ps4 will do about 1.2-1.4 billion. Switch about 450 million. (if it sells above 90 million which is likely).
I might be close at the end and we are maybe a bit too early in Switch's lifespan to tell, but considering the fact that the Switch is already outselling the xbox one in terms of software sales for this year up until now, I still think switch will win at the end. I mean the switch had no big exclusive nor a strong/any third party support this year and still is selling more software in its 2nd year on the market. Imagine what games are about to come … few Pokemon editions, Animal Crossing, probably a 2D Mario and Smash bros and presumably many more- all of those games will easily sell 10 million copies on the switch whereas it is doubtful that a single xbox one game could crack 10 millions after all (at retail of course!)