Any tax imposed pursuant to this part shall not apply with respect to any deed, instrument, or writing to a beneficiary or mortgagee, which is taken from the mortgagor or trustor as a result of or in lieu of foreclosure; provided, that such tax shall apply to the extent that the consideration exceeds the unpaid debt, including accrued interest and cost of foreclosure. Consideration, unpaid debt amount and identification of grantee as beneficiary or mortgagee shall be noted on said deed, instrument or writing or stated in an affidavit or declaration under penalty of perjury for tax purposes.
Ca. Rev. and Tax. Code § 11926