As part of their defense, Apple looks like it will be claiming violations of the 1st and 5th amendments.
The first because they can argue software as speech, which the government cannot compel.
The 5th amendment because besides the famous right to not self-incriminate it also has prohibitions against the government depriving a citizen of life or property without due process. Effectively the government would be conscripting Apples employees without just compensation.
http://arstechnica.com/tech-policy/...apple-to-plead-the-5th-in-iphone-crypto-flap/
I don't know if either argument will find traction in court but it's an interesting legal defense.
I'm also interested in just how far this Writs act could be pushed if the government wins. Could it compel more than a firmware update? Could it be used to compel creation of difficult or expensive software or hardware? What if what the court wants is technically impossible?