If you were to make a list of publicly traded homebuilders that had the best chance of weathering a prolonged slump in housing markets across the country, you might want to start with MDC Holdings (NYSE:MDC). The company, which specializes in building first-time move-up homes, reported a fourth-quarter loss and provided a generally gloomy outlook. But more importantly, it continued to strengthen its balance sheet and streamline operating expenses to ensure its survival.

For the quarter, MDC Holdings swung to a $6 million loss compared with $198 million in net income last year -- due to $91 million in pre-tax charges. These charges were taken because MDC believes the value of its land holdings is lower now because of the slump, and because it's had to walk away from some options to purchase land or mark down other projects. More than 80% of the impairment charges were related to frothy western markets such as California, Arizona, and Nevada.

Tough times ahead
Other indicators looked bleak as well. Compared with a year ago, MDC's fourth-quarter gross margin on homes fell more than 1,000 basis points to 16.6%. Like General Motors and Ford, MDC and its competitors have been offering heavy incentives to buyers. According to newspaper reports, some homebuilders have offered flat-panel TVs, cars, and mortgage payments. MDC's cancellation rate for the quarter also worsened to 55.65% from 33.8% a year ago -- this amounted to 2,044 canceled contracts for the quarter compared with 3,638 orders in MDC's backlog. Management said the higher rate was related to the heavy incentives others offered, which enticed more buyers to jump ship.

Batten down the hatches
Despite all the doom and gloom, there was a lot to like about MDC's quarter. Most importantly, the company took further steps to insulate itself from a prolonged slump.

The number of total lots it controls decreased 35% from a year ago, and lots controlled via options decreased 57%. This drastically decreases MDC's risk exposures, and management said the dollar value of its land options exposure was a minuscule $35 million. This deleveraging shored up the balance sheet. Thanks to a $400 million reduction in land inventory, MDC generated a little more than $400 million in operating cash flow in the fourth quarter, which boosted cash on the balance sheet to more than $500 million and helped increase book value (including impairments) by 10% year over year. As a result, MDC's debt-to-capital ratio fell to 18%, much lower than that of its peers -- such as Centex (NYSE:CTX), KB Home (NYSE:KBH), and Pulte Homes (NYSE:PHM) -- whose average ratio is 43%, according to MDC's estimates.

A value play?
It's near impossible to call the bottom of the housing cycle, but contrarian investors who wish to delve into the homebuilding industry would probably want to look at well-capitalized, profitable companies with strong management. MDC made $214 million for the year and made big cuts in its fourth-quarter operating expenses, so it would probably be a great place to start looking.

For more on MDC:

MDC Holdings is a Motley Fool Hidden Gems recommendation. If you're interested in small-cap companies with great potential, take a free 30-day trial to Hidden Gems.

Fool contributor Emil Lee is an analyst and a disciple of value investing. He doesn't own shares in any of the companies mentioned. The Motley Fool has a disclosure policy. Emil appreciates comments, concerns, and complaints.