(a) A qualified spousal trust may include a trust term that is not inconsistent with the provisions of this subchapter, including without limitation a discretionary power to distribute trust property to a person other than a settlor.
(b)
(1) Unless otherwise provided in writing by each settlor who transfers property to a qualified spousal trust, property that is held at any time in a qualified spousal trust, without regard to how the property was titled before the property was held:
(A) Has the same immunity from the claim of a separate creditor of either settlor as if the property were held outside the qualified spousal trust by both settlors as tenants by the entirety; and
(B) Shall be treated as tenants by entirety property for the purpose of immunity from federal and state bankruptcy laws.
(2) Property that is held in a qualified spousal trust is not immune from the claim of a creditor if the marriage of the settlors dissolves.