The good thing about closing costs is that they're negotiable, in some respects. You can't avoid paying underwriting fees or taxes to the government, for example, but you *can* arrange to have loan costs paid on your behalf. It's called a "zero-cost mortgage". But, there is a trade-off.
