15400. Unless a trust is expressly made irrevocable by the trustinstrument, the trust is revocable by the settlor. This sectionapplies only where the settlor is domiciled in this state when thetrust is created, where the trust instrument is executed in thisstate, or where the trust instrument provides that the law of thisstate governs the trust.15401. (a) A trust that is revocable by the settlor or any otherperson may be revoked in whole or in part by any of the followingmethods: (1) By compliance with any method of revocation provided in thetrust instrument. (2) By a writing, other than a will, signed by the settlor or anyother person holding the power of revocation and delivered to thetrustee during the lifetime of the settlor or the person holding thepower of revocation. If the trust instrument explicitly makes themethod of revocation provided in the trust instrument the exclusivemethod of revocation, the trust may not be revoked pursuant to thisparagraph. (b) (1) Unless otherwise provided in the instrument, if a trust iscreated by more than one settlor, each settlor may revoke the trustas to the portion of the trust contributed by that settlor, except asprovided in Section 761 of the Family Code. (2) Notwithstanding paragraph (1), a settlor may grant to anotherperson, including, but not limited to, his or her spouse, a power torevoke all or part of that portion of the trust contributed by thatsettlor, regardless of whether that portion was separate property orcommunity property of that settlor, and regardless of whether thatpower to revoke is exercisable during the lifetime of that settlor orcontinues after the death of that settlor, or both. (c) A trust may not be modified or revoked by an attorney in factunder a power of attorney unless it is expressly permitted by thetrust instrument. (d) This section shall not limit the authority to modify orterminate a trust pursuant to Section 15403 or 15404 in anappropriate case. (e) The manner of revocation of a trust revocable by the settloror any other person that was created by an instrument executed beforeJuly 1, 1987, is governed by prior law and not by this section.15402. Unless the trust instrument provides otherwise, if a trustis revocable by the settlor, the settlor may modify the trust by theprocedure for revocation.15403. (a) Except as provided in subdivision (b), if allbeneficiaries of an irrevocable trust consent, they may compelmodification or termination of the trust upon petition to the court. (b) If the continuance of the trust is necessary to carry out amaterial purpose of the trust, the trust cannot be modified orterminated unless the court, in its discretion, determines that thereason for doing so under the circumstances outweighs the interest inaccomplishing a material purpose of the trust. Under this sectionthe court does not have discretion to permit termination of a trustthat is subject to a valid restraint on transfer of the beneficiary'sinterest as provided in Chapter 2 (commencing with Section 15300).15404. (a) If the settlor and all beneficiaries of a trust consent,they may compel the modification or termination of the trust. (b) If any beneficiary does not consent to the modification ortermination of the trust, upon petition to the court, the otherbeneficiaries, with the consent of the settlor, may compel amodification or a partial termination of the trust if the interestsof the beneficiaries who do not consent are not substantiallyimpaired. (c) If the trust provides for the disposition of principal to aclass of persons described only as "heirs" or "next of kin" of thesettlor, or using other words that describe the class of all personswho would take under the rules of intestacy, the court may limit theclass of beneficiaries whose consent is needed to compel themodification or termination of the trust to the beneficiaries who arereasonably likely to take under the circumstances.15405. For the purposes of Sections 15403 and 15404, the consent ofa beneficiary who lacks legal capacity, including a minor, or who isan unascertained or unborn person may be given in proceedings beforethe court by a guardian ad litem, if it would be appropriate to doso. In determining whether to give consent, the guardian ad litem mayrely on general family benefit accruing to living members of thebeneficiary's family as a basis for approving a modification ortermination of the trust.15406. In determining the class of beneficiaries whose consent isnecessary to modify or terminate a trust pursuant to Section 15403 or15404, the presumption of fertility is rebuttable.15407. (a) A trust terminates when any of the following occurs: (1) The term of the trust expires. (2) The trust purpose is fulfilled. (3) The trust purpose becomes unlawful. (4) The trust purpose becomes impossible to fulfill. (5) The trust is revoked. (b) On termination of the trust, the trustee continues to have thepowers reasonably necessary under the circumstances to wind up theaffairs of the trust.15408. (a) On petition by a trustee or beneficiary, if the courtdetermines that the fair market value of the principal of a trust hasbecome so low in relation to the cost of administration thatcontinuation of the trust under its existing terms will defeat orsubstantially impair the accomplishment of its purposes, the courtmay, in its discretion and in a manner that conforms as nearly aspossible to the intention of the settlor, order any of the following: (1) Termination of the trust. (2) Modification of the trust. (3) Appointment of a new trustee. (b) Notwithstanding subdivision (a), if the trust principal doesnot exceed forty thousand dollars ($40,000) in value, the trustee hasthe power to terminate the trust. (c) The existence of a trust provision restraining transfer of thebeneficiary's interest does not prevent application of this section.15409. (a) On petition by a trustee or beneficiary, the court maymodify the administrative or dispositive provisions of the trust orterminate the trust if, owing to circumstances not known to thesettlor and not anticipated by the settlor, the continuation of thetrust under its terms would defeat or substantially impair theaccomplishment of the purposes of the trust. In this case, ifnecessary to carry out the purposes of the trust, the court may orderthe trustee to do acts that are not authorized or are forbidden bythe trust instrument. (b) The court shall consider a trust provision restrainingtransfer of the beneficiary's interest as a factor in making itsdecision whether to modify or terminate the trust, but the court isnot precluded from exercising its discretion to modify or terminatethe trust solely because of a restraint on transfer.15410. At the termination of a trust, the trust property shall bedisposed of as follows: (a) In the case of a trust that is revoked by the settlor, thetrust property shall be disposed of in the following order ofpriority: (1) As directed by the settlor. (2) As provided in the trust instrument. (3) To the extent that there is no direction by the settlor or inthe trust instrument, to the settlor, or his or her estate, as thecase may be. (b) In the case of a trust that is revoked by any person holding apower of revocation other than the settlor, the trust property shallbe disposed of in the following order of priority: (1) As provided in the trust instrument. (2) As directed by the person exercising the power of revocation. (3) To the extent that there is no direction in the trustinstrument or by the person exercising the power of revocation, tothe person exercising the power of revocation, or his or her estate,as the case may be. (c) In the case of a trust that is terminated by the consent ofthe settlor and all beneficiaries, as agreed by the settlor and allbeneficiaries. (d) In any other case, as provided in the trust instrument or in amanner directed by the court that conforms as nearly as possible tothe intention of the settlor as expressed in the trust instrument. (e) If a trust is terminated by the trustee pursuant tosubdivision (b) of Section 15408, the trust property may bedistributed as determined by the trustee pursuant to the standardprovided in subdivision (d) without the need for a court order. Ifthe trust instrument does not provide a manner of distribution attermination and the settlor's intent is not adequately expressed inthe trust instrument, the trustee may distribute the trust propertyto the living beneficiaries on an actuarial basis.