So while playing one of my fortresses, a wagon got stuck leaving the depot and decided to sit there. Eventually, it broke and the merchants all ran away, but a curious thing happened. Two of the caravan guards remained beside it. So as the months turned into years, these few soldiers stayed by my fortress, never leaving, never going mad, never starving. And that's when it occurred to me. What if I could separate the soldiers from the caravan? The caravans don't care when soldiers don't come back, and the soldiers remained friendly after caravans had left. It would be a perfect backup for my fortress, a lever that can simply release an army of friendly soldiers into the enemy ranks, eager to path from the interior of my fort to the exit, undoubtedly through the front lines of the goblin invaders. So construction was begun, on the first guard-capturing system. It was a simple thing, simply a depot surrounded by retractable bridges, as soldiers have a tendency to walk around the outside of the depot while the merchants remain within, and although inefficient, it did begin to have some results.
This inefficiency, of course, was unacceptable, so I decided to refine my system. A caged troll was placed on a platform opposite a bridge beside my depot, and a window was build between them. When soldiers arrived, the troll could be released, and being a building destroyer, would remain by the window in order to break it, while the soldiers would path across the bridge and be trapped below. This system, while still not perfect, resulted in a roughly 95% efficiency, with nearly all soldiers being captured underneath. It however, also generally cost a troll.
During the following goblin Siege, the spike pit trap that was connected to my detainee pit, which I was testing in the meantime, began to have a curious result. Arrows were being fired out of it into the goblin horde, and I certainly did not post any archers there. The captured archers were firing out of the pit and into any goblin that pathed within range.
This, of course, made me realize that it would be very possible to set up a system for caging archers, then releasing them into guard towers where they will defend your fortress at all times, never tiring, never needing breaks. Now, of course, I needed to figure out the logistics of such a task. Initial attempts at causing soldiers to be trapped by fall damage were... unsuccessful, however a cave in due to a poor channel design gave me an idea. Dust from cave ins will knock any creature unconscious, and it can easily be manufactured where necessary. This system, of course, resulted in several redesigns to my capturing apparatus, the main difference being a new system was required to produce the dust. The end result was very good, with very low casualties, and a very high caging rate. Archers could now be placed where required, attached to a lever, boxed in with fortifications, and released to provide covering fire for dwarves in case of a seige, ambush, or theives. Melee soldiers, on the other hand, I discovered could be chained wherever necessary.
As of now, (practical) uses of your new soldiers include:
Last line of defense- soldiers will path towards the exit, and assuming your depot is near the entrance, this will likely be straight through the goblin soldiers
Archers- They can be on duty at all times, theives will be cut down mercilessly upon discovery. Some method of cutting off their line of sight, drawbridges for example, is recommended in case of elite archers. Note that they don't have infinite ammunition
Sentries- More likely to survive a goblin ambush than your average kitten.
Guards- A soldier is far stronger than a war dog, and unlike the dog will gain experience in his/her weapon of choice. Life expectancy is considerably longer as well.
Pit Traps- After a fall, goblins are essentially defenceless. A single soldier locked at the bottom of your pit trap will be able to easily dispatch anything that survives the fall.
There's some less practical uses as well,
Host gladiatorial matches between them and captured goblins. How about a three way match with a hydra as well? Entertainment for everyone, and no tantrums at the end!
A warning: I have yet to experiment in-depth with using soldiers when the faction said soldiers belong to is at war with you (ex, humans seige you, will your 'mercenaries' switch sides?) so be wary of your newly positioned archers firing upon you. Consider having a cutoff switch, to block their view in case of betrayal. Early tests on a captured fortress where goblins were friendly on reclaim resulted in three out of forty goblins remaining loyal to the fortress upon seige, one of which died immediately, and another which switched sides again partway through the battle. All three who remained loyal had been in combat and killed goblin ambushers, which implies loyalties might shift from killing soldiers from the parent faction. In the same fortress, a human seige did not cause any human soldiers to switch sides, but all soldiers in question were still caged, awaiting transport to their new post. It is unknown if this changes anything, as tests are still underway.
Note that I originally posted this to the DF wiki and was encouraged to post it here. This is basically word-for-word what I posted there with a few very minor edits.