No local-government leader wants to file for municipal bankruptcy. Not only is it perceived as an admission of failure, but it's expensive. Every dollar spent for legal and accounting costs is a dollar less to get the city or county back on its feet with a realistic chance for the future. It is a dollar less for a police car, a snowplow or a pension payment down the road. Every dollar spent on the bankruptcy process is a dollar less to invest in critical public safety and the infrastructure so vital to a lasting recovery.

Robert Fishman, the U.S. Bankruptcy Court-appointed fee examiner in Detroit's bankruptcy, has reported that in just the first three months of the proceedings the Motor City's lawyers and some of its numerous consultants sent taxpayers bills totaling $11.4 million for their services-not including Fishman's firm's costs, which added another nearly $2 million. He told U.S. Bankruptcy Judge Steven Rhodes that he believes that all of the requested fees are "commensurate with the complexity and speed of the case."

But those early costs are likely to pale in comparison to those of the last few months, when the city and its creditors were in court on an almost-weekly basis. And if that weren't bad enough for Detroit's taxpayers, they have since been stuck with a tab of more than $1.16 million for the legal defense of former mayor Kwame Kilpatrick and his father in their the City Hall corruption case. The former mayor, who was convicted, appears to have played a central role in the events that steered the iconic city into municipal bankruptcy.

If Jefferson County, Ala., is a guide, Detroit's taxpayers are in for a lot more fiscal pain. Best estimates are that the county, with a population of nearly 80 percent of Detroit's, has so far spent nearly $35 million in legal fees to exit municipal bankruptcy. Vallejo, Calif., with a population of about 116,000, has spent about $13.2 million. Stockton, Calif., has spent about $12 million. It's almost mind-boggling to consider the size and cost of these legal and accounting bills after a locality has become -- after all -- insolvent.

The issue in each of these cases is the complex challenge of obtaining certainty with regard to the amount of debt being addressed, as well as the number of competing interests that must be considered. In its bankruptcy filing, San Bernardino, Calif., lists its debtors in 86 tiny-print pages. In Detroit, the federal bankruptcy court could begin to consider as early as next month whether the city's proposed plan of allocations -- or "haircuts" -- to be divvied up among its more than 100,000 creditors is fair. It is mind-bending to even imagine the number of diverse problems that must be simultaneously considered and solved in these cases. So getting the facts right, trying to weigh and balance the merits and equities of each creditor's case, and trying to ensure avoidance of further legal challenges or appeals requires meticulous care. That is always going to be an expensive process.

With more than a million U.S. corporations seeking federal bankruptcy protection last year, we can understand how misfortune, poor decisions and other factors can lead to insolvency. But for a city or county, simply ceasing the provision of essential services -- locking the doors to City Hall and walking away -- is not an option. So getting it right requires what seems an extraordinary investment. But it is an investment not just important to ensuring a sustainable future for a municipality but also to try to ensure that the final plan put before the bankruptcy court can offer a quidepost for the future.

Detroit and San Bernardino, in particular, carry an extra burden. The 6th and 9th U.S. Courts of Appeal have pending before them cases challenging these cities' bankruptcy proceedings -- cases that could go all the way to the U.S. Supreme Court and set a precedent for every local government in the country.

These cases are in uncharted waters, but these are cities that are responsible for the health and safety -- and future -- of hundreds of thousands of Americans. The quality of care and commitment to getting it right could have a profound impact on the future of governance and federalism in America.