Well this has been spoken about a fair bit.
But still, god I would love for suddenly all the corpses to rise and start attacking the fortress as zombies and skeletons. Would be so awesome.
Unburied or otherwise badly respected corpses[1] should attack the fortress (depends on biome type/relative proportion/exact location where felled, and possibly factors relating to what the trigger is for them to rise). But properly tomb-buried or (to some extent) suitably commemorated fallen dwarves, pets, war animals, etc that died exhibiting great valour should do what all great warriors do and arise in times of trouble (c.f. Drake's Drum, King Arthur asleep under the hill, etc) in order to help their own side, or at least rally them in ghost form.
They should perhaps be less likely to be helpful if they were the sole dwarf sent out to deal with the siege, of course. There might be a balancing act needed on the various variable conditions so that one couldn't just have a Undead Shock-Troops Factory by sequentially sending individuals out on suicidal mêlée charges, shortly afterwards wiping out the opposition with the bowdwarves that had been previously held back and then burying the fallen in massively over-engineered and decorated tombs in the expectation that next time you need a handy force to deal with an awful foe you'll get some magically re-animated armour and weaponry automatically stomping into battle for you.
[1] Could also count for hunters not paying due service to the spirits of the wildlife animals they kill. "Oh great moose, you were a great foe, and I take your corpse into the fortress only so that we may feed. Unless it happens to rot because some berk has cluttered up the butchers and forgotten to tell the cook to make lavish meals. Or your fine hide becomes untannable because someone forgot that Urist The Tanner is also on military duty this half of the year. And as for the bolts we'd be making from your bones, hell, I'm sure they deliberately miss the target and break them on the range walls... And so, great moose, I lay you at peaceful rest, and if your spectral form ends up manifesting itself and killing me in some absurd way, I'll bloomin' well materialise myself next to your restless spirit and chop your ghostly legs off one by one, so help me Armok..."