Yes it does work. It's important to borrow to buy the new house BEFORE you blow your credit rating by returning your keys for the old one though.
I read lately that there is a tax cost because the repayments avoided/forgiven is considered taxable. A VERY knowledgable RE guy said that, not me. :)