I'd rather have 20 untrained marksdwarves facing a goblin siege than 5 expertly trained. Because long before the goblins make it to melee range, they'll break and run in panic. It's a matter of how much sheer firepower you can put out. If you're good, you can even get away with wooden bolts (although I like to embark on iron-heavy sites just for iron bolts).
Can't marksdwarves also use shields in their off-hand? Seems to me that you could train them up on shields only in the danger room until they're legendary, at which point they'll be able to block just about anything.
...I kinda like the thought of dwarves hiding behind tower shields, winching up their crossbows, then popping out to fire.
Goblins
never make it to melee range if you use fortifications and only accomplished (skill level 10) archers can shoot back at your marksdwarves unless they are standing right next to the fortifications, which is impossible if you dig a ditch.
I have found that advanced goblin archers are very rare, either its a goblin leader or its much later in the game where your marksdwarfs should be decked out in armor and high levels in dodge and marksdwarfship.
I don't even bother giving my marksdwarves shields either, since my melee squads are the ones who engage after the marksdwarves soften them up or make them flee.
They don't get away though...
"Oh, I'm afraid the deflector bridge will be quite operational when my friends arrive!"