
183 S.W.3d 482 (2005)
ROSA'S CAFÉ, INC.; Bobby Cox Companies, Inc.; and the Bobby Cox Companies Employee Injury Benefit Plan, Appellants,
v.
Mitch WILKERSON, Individually and as Surviving Spouse and Representative of the Estate of Johnna Jean Wilkerson, Deceased; and David Medlin, as Next Friend and Natural Father of Jonathan David Medlin, a Minor, Appellees.
No. 11-05-00144-CV.
Court of Appeals of Texas, Eastland.
December 21, 2005.
*484 Gary D. Sarles, Sarles & Ouimet, L.L.P., Dallas, for appellants.
Steven L. Clack, Kerrville, Phillip Godwin, Odessa, Michael C. Tighe, McKinney & Tighe, L.L.P., Midland, for appellees.
Panel consists of: WRIGHT, C.J., and McCALL, J., and McCLOUD, S.J.[*]

OPINION
AUSTIN McCLOUD, Senior Justice (Retired).
This appeal involves the enforcement of a subrogation provision contained in a settlement agreement executed in conjunction with the payment of death benefits under an ERISA benefit plan. See Employee Retirement Income Security Act, 29 U.S.C. § 1001-1461 (2005). The parties executed the settlement agreement after a fatal automobile accident which caused the death of the plan participant. Under the terms of the settlement agreement, the benefit plan was entitled to recover reimbursement for all of the death benefits paid under the plan from any recovery obtained by the plan beneficiaries from the third-party tortfeasor. The trial court did not enforce the reimbursement provision of the settlement agreement. We reverse and render in part and remand in part.

Background Facts
Johnna Jean Wilkerson died as a result of an automobile accident alleged to have been caused by the negligence of Lois Hesser. The decedent was an employee of Rosa's Café, Inc. at the time of the accident (May 10, 2002). As an employee, the decedent was a participant in a benefit plan provided by her employer.[1] Under the terms of the plan, the decedent's surviving spouse and minor child were entitled to death benefits as a result of the decedent's death occurring during the course of her employment.[2]

The First Lawsuit and Resulting Settlement Agreement
In order to facilitate the payment of the death benefit to Wilkerson and the minor child, appellees filed suit in the 385th District Court of Midland County on November 14, 2002, against Rosa's Café, Inc. The parties, including a guardian ad litem appointed to represent the minor child, executed a document entitled "Settlement, Indemnification, and Subrogation Agreement" (the settlement agreement) in conjunction with the friendly suit on November 21, 2002. With respect to the right of appellants to obtain reimbursement for the death benefits paid to appellees under the plan, the settlement agreement provided as follows:
8. Each of the undersigned signatories for the Releasors acknowledges that he has read the subrogation provisions in Section V.C. of the Plan, which Section *485 V.C. is incorporated by reference into this Agreement the same as if it were set forth here in full. Mr. Wilkerson, both individually and as Independent Executor of the Will and Estate of Johnna J. Wilkerson, Deceased, and Jonathan David Medlin, each agrees, represents and warrants that he will perform all of the obligations set forth in Section V.C. of the Plan, and each of them agrees and acknowledges that the Plan, Bobby Cox Companies, Inc. and Rosa's Café, Inc. have all of the rights set forth in Section V.C. of the Plan and that they are entitled to subrogate and to recover the full amount of $230,230, without any offsets or reductions to that amount, from any recovery, by settlement or judgment, that Mr. Wilkerson, Mrs. Wilkerson's estate and/or Jonathan David Medlin may make on any claim or in any lawsuit against Mrs. Lois Hesser, based on Mrs. Wilkerson's death or fatal injuries, or otherwise arising out of the Automobile Accident, excepting only Social Security benefits and life insurance proceeds that they may receive as a result of Mrs. Wilkerson's death. Mr. Wilkerson, both individually and as Independent Executor of the Will and Estate of Johnna J. Wilkerson, Deceased, and Jonathan David Medlin each agrees, represents and warrants that he will permit and assist the Bobby Cox Companies Employee Injury Benefit Plan to intervene in any lawsuit against Mrs. Hesser, that he will cooperate in all respects with the Plan in exercising in such lawsuit its subrogation rights in this paragraph, and that, through his counsel, he will provide prior notice to counsel for the Plan of all settlement negotiations, hearings, mediations, trial settings and depositions.[3] (Emphasis added)
In addition to the foregoing provision, the signature pages for Wilkerson, Medlin, and the minor's guardian ad litem contained *486 the following language which the respective signatories swore to under oath before a notary:
I also understand that the Bobby Cox Companies Employee Injury Benefit Plan will be entitled to receive the first $230,230, without offset or reduction, from any settlement with or judgment against anyone else in connection with [my wife's/my son's mother's/Mrs. Wilkerson's] death and fatal injuries.
The trial court entered a judgment in the first lawsuit which incorporated the terms of the settlement agreement and expressly approved its terms. None of the parties appealed the judgment.

The Second Lawsuit
This appeal arises from the suit appellees filed against Hesser in the 142nd District Court of Midland County. Appellees reached an agreement with Hesser wherein Hesser confessed judgment in the amount of $2,000,000. However, appellees agreed to accept the sum of $255,000 from Hesser in settlement for the confessed judgment amount. Appellants filed a plea in intervention in order to obtain reimbursement from the recovery obtained by appellees from Hesser. Appellants asked the trial court to enforce the terms of the settlement agreement by requiring appellees to reimburse them for the death benefits paid under the plan from the $255,000 paid by Hesser to appellees.
The parties submitted their contentions to the trial court on an informal basis. After hearing arguments and receiving post-submission briefs from the parties, the trial court denied in part appellants' intervention claim. The trial court apportioned the settlement funds received from Hesser in three equal shares of $85,000 between Wilkerson, the minor child, and the decedent's estate. The trial court awarded the $85,000 apportioned to the decedent's estate to appellants under the court's interpretation of the benefit plan's terms.[4] Appellants challenge the trial court's judgment in two issues.

Issues on Appeal
Appellants assert in their first issue that the trial court erred by ignoring the express terms of the settlement agreement requiring complete reimbursement for the $230,230 paid in plan benefits. In their second issue, appellants argue that the judgment entered in the first lawsuit prevents appellees from raising any defenses to the enforcement of the settlement agreement. Each of appellants' issues are premised on the assertion that the trial court should have enforced the terms of the settlement agreement as written.

Analysis
In the absence of formal findings of fact and conclusions of law, the trial court's judgment will be upheld on any legal theory that finds support in the evidence. Worford v. Stamper, 801 S.W.2d 108, 109 (Tex.1990). The briefs filed in this appeal address two legal theories which would support the trial court's judgment. The first theory relates to the trial court's informal statement that the ruling was based on its interpretation of the terms of the benefit plan rather than the terms of the settlement agreement. The second theory involves appellees' contention both at trial *487 and on appeal that appellants were not entitled to complete reimbursement of their subrogation claim under the "made whole" doctrine. See Ortiz v. Great S. Fire & Cas. Ins. Co., 597 S.W.2d 342, 344 (Tex.1980).

The Express Terms of the Settlement Agreement
Appellants assert that the trial court erred by ignoring the express terms of the settlement agreement requiring complete reimbursement of the $230,230 paid in plan benefits. In construing a written contract, the primary concern of the court is to ascertain the true intentions of the parties as expressed in the instrument. Coker v. Coker, 650 S.W.2d 391, 393 (Tex.1983). If the written instrument is worded so that it can be given a certain or definite legal meaning or interpretation, then the instrument is not ambiguous; and the court will construe the contract as a matter of law. Id. at 393. The terms of the settlement agreement which we have previously quoted at length expressly provide that appellants are entitled to full reimbursement for the $230,230 in death benefits paid to Wilkerson and the minor child from any recovery they obtained from Hesser without offset or reduction.
The trial court implicitly rejected the terms of the settlement agreement by utilizing a construction of the original benefit plan's terms in reaching its decision. The trial court erred in this regard. The subsequently executed settlement agreement contained the following provision:
This Agreement contains the entire agreement between the parties to this Agreement, reduced to writing, and supersedes and cancels any and all prior agreements and arrangements as to the matters covered herein or relating hereto.
This provision is typically referred to as a "merger clause." In general, a merger clause is a contractual provision to the effect that the written terms of the contract may not be varied by prior agreements because all such agreements have been merged into the written document. See IKON Office Solutions, Inc. v. Eifert, 125 S.W.3d 113, 125 n. 6 (Tex.App.-Houston [14th Dist.] 2003, pet. denied)(citing BLACK's LAW DICTIONARY 989 (6th ed.1990)). To the extent the terms of the original benefit plan might have contradicted the terms of the settlement agreement, the terms of the settlement agreement prevail under the merger clause.[5] Appellant's first issue is sustained.
In their second issue, appellants argue that the incorporation of the settlement agreement into the judgment entered in the first lawsuit prevents appellees from collaterally attacking the enforcement of the settlement agreement in this proceeding. Appellants are correct in this regard. When an agreement between parties has been approved by a court and made a part of its judgment, the agreement is no longer merely a contract between private individuals but is the judgment of the court. Ex parte Gorena, 595 S.W.2d 841 (Tex.1979). Parties may not raise contractual defenses to an agreement incorporated into a judgment because such defenses constitute impermissible collateral attacks on the prior judgment. Id. Appellants' second issue is sustained.

The Made Whole Doctrine
Appellees contend that appellants are not entitled to recover full reimbursement *488 for the $230,230 paid in plan benefits because they were not "made whole" by Hesser for their losses resulting from the decedent's death. Under the made whole doctrine, an insurer is not entitled to subrogation if the insured's loss is in excess of the amounts recovered from the insurer and the third party causing the loss. Ortiz, 597 S.W.2d at 344. The made whole doctrine is an equitable theory based upon the concept that if either the insurer or insured must go unpaid, the insurer should bear the loss. Esparza v. Scott & White Health Plan, 909 S.W.2d 548, 551-52 (Tex.App.-Austin 1995, writ denied). The doctrine has been applied in a variety of contexts to reduce or eliminate an insurer's subrogation claim. See Fortis Benefits v. Cantu, 170 S.W.3d 755 (Tex. App.-Waco 2005, pet. filed)(contractual subrogation); Texas Ass'n of School Boards, Inc. v. Ward, 18 S.W.3d 256 (Tex. App.-Waco 2000, pet. denied)(statutory subrogation); Esparza, 909 S.W.2d at 551-52 (contractual subrogation). Since appellants' subrogation claim arises from contractual provisions, we focus our attention on the cases discussing contractual subrogation.
Appellees contend that the recent holding in Fortis Benefits is dispositive. Fortis Benefits involved a subrogation claim of an insurer that provided health insurance benefits. The insurer asserted that the made whole doctrine does not apply to a contractual subrogation claim. Relying upon the holding in Esparza, the court rejected the insurer's contention. Fortis Benefits, 170 S.W.3d at 758. In Esparza, the court held that the application of the made whole doctrine cannot be summarily overcome by a boiler-plate provision in an insurance contract that purports to entitle the insurer to subrogation out of the first monies received by the insured. Esparza, 909 S.W.2d at 551-52. The court ruled that, "[w]hile an insurance contract providing expressly for subrogation may remove from the realm of equity the question of whether the insurer has a right to subrogation, it cannot answer the question of when the insurer is actually entitled to subrogation or how much it should receive." Esparza, 909 S.W.2d at 551. (Emphasis in original)
Fortis Benefits and Esparza would be analogous to the facts in this case if appellants were only relying upon the subrogation provision contained in the original benefit plan. In this regard, we do not question the propriety of applying the made whole doctrine to an insurance contract written before the insurer and insured have knowledge of the circumstances which will cause the payment of benefits under the policy. The facts in this appeal are much different. Here, the subrogation claim arises from a settlement agreement executed after the event which triggered the payment of benefits giving rise to the subrogation claim. The parties, aided by counsel, presumably had knowledge of the loss sustained by the insured and of the third-party tortfeasor's financial wherewithal to compensate the insured for its loss. The settlement agreement expressly provides that appellants are entitled to complete reimbursement from the recovery obtained from Hesser without any reduction or offset. We conclude that the parties contractually waived the application of the made whole doctrine by executing the settlement agreement under these circumstances.

This Court's Ruling
The judgment of the trial court is reversed. Judgment is rendered that Rosa's Café, Inc.; Bobby Cox Companies, Inc.; and the Bobby Cox Companies Employee Benefit Plan recover $230,230 from the $255,000 paid by Hesser to appellees. All *489 remaining issues are remanded to the trial court.
NOTES
[*]  Austin McCloud, Retired Chief Justice, Court of Appeals, 11th District of Texas at Eastland sitting by assignment.
[1]  Appellants are the decedent's employer, Rosa' Café Inc; the benefit plan, the Bobby Cox Companies Employee Injury Benefit Plan; and the sponsor and administrator of the benefit plan, Bobby Cox Companies, Inc.
[2]  Appellees are Mitch Wilkerson (Wilkerson), the decedent's surviving husband, and David Medlin (Medlin), the father of her surviving minor child, Jonathan David Medlin. Wilkerson filed suit in both his individual capacity and as representative of the decedent's estate. Medlin filed suit solely in a representative capacity on behalf of the minor.
[3]  Section V.C. of the plan provided in relevant part as follows:

1. If a Participant (or if the Participant's Death Beneficiaries, spouse, heirs, parents or legal representatives) seeks, becomes entitled to, or receives Plan benefits for any injury or death caused by the negligent or wrongful act or omission of any person, entity or organization other than the Company or an Employer, and is entitled to or recovers any damages or other compensation (in any form) on account of the injury or death, whether by insurance, litigation, arbitration, settlement or otherwise, the Participant (or his or her Death Beneficiaries, spouse, children, heirs, parents or legal representatives) shall:
a. subrogate his or her right to and reimburse the Plan out of said damages or other compensation (including, if necessary, all such damages or other compensation received by the Participant including, without limitation, punitive or exemplary damages and any interest awarded and any portion awarded or paid to the Participant as attorney's fees or to otherwise compensate the Participant's attorney for pursuing the claim against the person, entity or organization) to the full extent (i.e. 100%) of the Plan benefits paid to and on behalf of the Participant and without regard to whether said damages or other compensation fully compensate the Participant for his or her injuries and claims against the person, entity or organization, without regard to whether the Participant was able to recover the full amount of his or her claims against the person, entity or organization, and without regard to the nature of the damages or other compensation recovered by the Participant.
2. A Participant, by participation in this Plan, agrees that his or her Death Beneficiaries, spouse, children, heirs, parents and legal representatives shall be obligated to comply will all of the Participant's obligations under this Paragraph with regard to any claim arising from an injury to or the death of the Participant, and the receipt and acceptance of all or part of a Death Benefit shall constitute agreement and acceptance by the accepting person or entity of all the terms and conditions of the Plan, including those of this Paragraph.
[4]  The trial court did not enter formal findings of fact and conclusions of law. However, the trial court sent a letter to the parties which explained the rationale for its ruling. The trial court based its determination on its interpretation of the plan's terms. The court concluded that, under the terms of the benefit plan, appellants were only entitled to recover reimbursement for benefits paid directly to a plan participant but not a beneficiary of a death benefit paid under the plan.
[5]  As a result of our holding in this appeal, we do not review the trial court's interpretation of the original benefit plan's terms.
