Comparing their sales if you align them from when they were launched, the story looks like this:
And I'm only doing their first 2 full years, since the Xbox One is still only 3/4ths into it's 3rd year.
Nintendo 3DS
Year 1 sales - Feb. 26, 2011 - Feb. 25, 2012 - 14,361,871 -
Year 2 sales - Feb. 26, 2012 - Feb. 23, 2013 - 27,693,898 -
Notable releases/events - (Launch of the Nintendo 3DS XL, Super Mario 3D Land, New Super Mario Bros. 2, Mario Kart 7, Paper Mario: Sticker Star, The Legend of Zelda: Ocarina of Time 3D, Animal Crossing: New Leaf, and Fire Emblem: Awakening. (the last 2 were only released in Japan by the end of Year 2.))
Xbox One
Year 1 sales - Nov. 23, 2013 - Nov. 22, 2014 - 7,768,163 -
Year 2 sales - Nov. 23, 2013 - Nov. 21, 2015 - 16,074,006 -
Notable releases/events - (Launch in China, Halo 5: Guardians, Halo: The Master Chief Collection, Gears of War: Ultimate Edition, Forza Horizon 2, Forza Motorsport 5 & 6, some big 3rd party releases such as the COD series, Grand Theft Auto 5, FIFA, NBA 2K, Assassin's Creed, etc.
So for their first 2 years, the 3DS is ahead of the Xbox One, by a pretty comfortable margin I might add, but there is still A LOT that these 2 systems had left in the tank, or still have in the case of the Xbox One.
As it heads into it's 3rd complete year, the Xbox One is expecting to launch its slim model, the Xbox One S, later this year, along with Gears of War 4 and ReCore, and then there's Project Scorpio that's looming on the horizon as well! The system will also continue to get strong 3rd party support which will definitely help extend its life cycle a good year or two.
But on the 3DS' side of things, within its 3rd year it got its number 1 superstar title, its very own Pokemon game in the form of Pokemon X/Y, a few more notable games that launched in its 3rd year include, Luigi's Mansion 2, Tomodachi Life, Mario & Luigi: Dream Team, Monster Hunter 4, the localizations of Animal Crossing: New Leaf and Fire Emblem: Awakening, Mario Party: Island Tour, and The Legend of Zelda: A Link Between Worlds, finally, the 2DS launched in that year as well, and I'm also not sure about this, but I think development for the New Nintendo 3DS models started around this time period.
So it should definitely be interesting to see how this plays out!