Check out
http://www.competitivecyclist.com/za/CCY?PAGE=FIT_CALCULATOR_INTRO for a fit calculator. You probably want a fit thatis a bit less aggressive than cross-country, though it depends what type of routes you are riding your flexibility, etc.
5'10" is not really diagnostic unto itself. What is your inseam? I have a long inseam for my height, so I need to size on the short side; you can easily move your seat up and down, but shortening the top tube is impossible (though you can fine-tune it with stem, it also messes with steering feel). FWIW, I am comfortable on my large fargo at 5'11", but I test road both large and medium before going that route, as I too am on the cusp. Good luck!