
994 S.W.2d 810 (1999)
CONVERSION PROPERTIES, L.L.C., Appellant,
v.
Joan Wilson KESSLER and Karen Ledesma, Appellees.
No. 05-97-00056-CV.
Court of Appeals of Texas, Dallas.
May 24, 1999.
*811 T. Rick Frazier, Law Office of T. Rick Frazier, Dallas, for Appellant.
Raoul Smyth, Irvine, CA, for Appellees.
Before Justices MORRIS, WHITTINGTON, and ROACH.

OPINION
Opinion By Justice ROACH.
This is a declaratory judgment suit involving the distribution of surplus proceeds generated by a junior lien foreclosure and sale of property owned by appellees Joan Wilson Kessler and Karen Ledesma. Conversion Properties, L.L.C. appeals the trial court's disposition of cross motions for summary judgment. In six points of error, appellant generally asserts the trial court erred in granting appellees' motion for summary judgment and denying its motion for summary judgment because the surplus proceeds should be applied to reduce the debt secured by the senior lien before being distributed to appellees. Concluding that the surplus proceeds cannot be used to reduce the indebtedness secured by the senior lien, we affirm the trial court's judgment.

FACTS
On April 28, 1989, Kessler and Ledesma purchased a home in Dallas County. As part of the purchase price for the home, they assumed the obligation to pay a note in favor of Nowlin Mortgage Company that was secured by a deed of trust (first deed of trust). Also in connection with the purchase of the home, appellees executed a note for $36,364 in favor of Guaranty Federal Savings Bank. The Guaranty Federal note was secured by a second deed of trust on the home. Upon default, the trustee was empowered to sell the property referenced in the second deed of trust with the proceeds to be applied in the following order: (a) all reasonable costs and expenses of the sale; (b) sums secured by *812 the deed of trust; and (c) any excess to the persons legally entitled thereto.
Appellees defaulted on the Guaranty Federal note and the substitute trustee commenced foreclosure proceedings. A sale was held on December 5, 1995, and Conversion Properties purchased the property for $50,000. From the proceeds of the foreclosure sale, the trustee allocated $1,250 for trustee's fees, and paid $33,958.92 to Guaranty Federal, leaving a surplus of $14,791.08. Conversion Properties claims it was unaware of the existence of the first deed of trust at the time it purchased the property.[1] Upon learning of the first deed of trust and appellees' default on the underlying obligation, Conversion Properties made the delinquent payments. It later paid an additional $12,524.71 toward the principal owed on the prior note. Conversion Properties then entered into a subrogation agreement with the holder of this note to the extent of Conversion Properties's payments.
As holders of the equity of redemption, appellees requested the trustee to release the surplus funds to them. Conversion Properties, on the other hand, claimed the surplus funds should be applied to the debt secured by the first deed of trust. Specifically, Conversion Properties asserted it was entitled to the surplus funds to the extent of the payments it had made on the senior lien indebtedness under the theory of equitable subrogation.
Appellees filed this declaratory judgment action pursuant to Chapter 37 of the Texas Civil Practice and Remedies Code seeking a declaration that (1) they were entitled to the surplus foreclosure proceeds as holders of the equity of redemption, and (2) Conversion Properties's subrogation claims were invalid. Conversion Properties filed a counterclaim requesting contrary declarations. Both parties filed motions for summary judgment. The trial court denied Conversion Properties's motion and granted appellees'. It also awarded appellees $3,000 in attorney's fees. Conversion Properties appeals both the denial of its motion and the granting of appellees' motion.

Discussion
To prevail on a summary judgment motion, a plaintiff must conclusively establish all elements of its cause of action. See MMP, Ltd. v. Jones, 710 S.W.2d 59, 60 (Tex.1986) (per curiam); TEX.R. CIV. P. 166a(c). When as here, cross motions for summary judgment were before the trial court and one motion is granted and the other denied, we determine the propriety of the court's ruling on each motion. See Jones v. Strauss, 745 S.W.2d 898, 900 (Tex.1988).
Under its first and second points of error, Conversion Properties asserts Summers v. Consolidated Capital Special Trust, 783 S.W.2d 580 (Tex. 1989), requires surplus foreclosure proceeds be applied to the indebtedness secured by the first deed of trust as a matter of law. For the reasons that follow, we do not agree.
Summers involved the foreclosure of a wraparound note secured by a junior deed of trust. See id. at 580-81. In a wraparound financing arrangement, the purchaser accepts title to the property subject to any existing liens and executes a note that includes the principal balance of the underlying indebtedness secured by the prior existing liens. See id. at 581. The Summers court held that when a deed of trust lien securing a wraparound note is foreclosed, the trustee, acting for the note holder, is obliged by implied covenant to apply the net sales proceeds to discharge the entire wrapped indebtedness as reflected in the note. Id. at 583. Because the principal amount of the wraparound *813 note being foreclosed includes the principal balances of the pre-existing notes, the Summers court determined that the proceeds from the foreclosure sale must first be applied to the total outstanding balance on the wraparound note, including the preexisting debt, before making any distribution to the debtor. See id.
Conversion Properties suggests that we imply a similar covenant in the second deed of trust in this case so that excess foreclosure proceeds will be applied to reduce the indebtedness secured by the first deed of trust. In light of the obvious differences between a wraparound financing arrangement and the conventional junior deed of trust lien involved in the present case, we are unpersuaded that Summers is controlling authority in this case and, therefore, decline Conversion Properties's invitation. See Janet L. Hunter, Note, Texas Adopts the "Outstanding Balance" Method of Calculating the Deficiency or Surplus After Foreclosure of a Wraparound Deed of Trust: Summers v. Consolidated Capital Special Trust, 783 S.W.2d 580 (Tex.1989), 21 TEX. TECH L. Rev. 873, 875-77, nn. 22-23 (1990) (explaining the differences between wraparound mortgages and conventional second mortgage situation). Here, unlike in Summers, the second deed of trust secures only the principal balance of the Guaranty Federal note. In fact, at the bottom of the first page of the second deed of trust, there is a notation, "Texas-Second Mortgage-5/82-Purchase Money-FHMA/FHLMC Uniform Instrument," indicating the existence of a prior encumbrance.
The power of a trustee to sell the property for the parties is derived solely from the deed of trust and can only be exercised in strict compliance with the note and conditions of sale. Bonilla v. Roberson, 918 S.W.2d 17, 21 (Tex.App.-Corpus Christi 1996, no writ). The trustee must therefore "strictly pursue the terms of the instrument, the provisions of law relative to such sale and the details prescribed as to the manner of the sale." Id. The foreclosure sale purchaser obtains only that title which the trustee has authority to convey. Id.
Foreclosure does not terminate interests in the foreclosed real estate that are senior to the mortgage being foreclosed. RESTATEMENT (THIRD) OF PROPERTY: Mortgages § 7.1 (1997). In fact, the general rule is that the successful bidder at a junior lien foreclosure takes title subject to the prior liens. See id. cmt. a; W. MIKE BAGGETT, TEXAS FORECLOSURE LAW & PRACTICE § 2.69 (1984); 59 C.J.S. Mortgages § 549 (1998); 59A C.J.S. Mortgages § 601 (1998). The purchaser takes the property charged with the primary liability for the payment of the prior mortgage and must therefore service the prior liens to prevent loss of the property by foreclosure of the prior liens. See 55 AM.JUR.2d Mortgages § 808 (1996); BAGGETT, supra. Consequently, as a practical matter, a prospective purchaser usually will subtract the amount of any outstanding senior liens from the fair market value of the property in calculating its foreclosure bid. See RESTATEMENT (THIRD) OF PROPERTY: Mortgages, supra § 7.1 cmt. a.
If there are surplus proceeds generated by the foreclosure sale after paying the trustee's fees and expenses and the existing indebtedness secured by the foreclosed lien, they are distributed to inferior lienholders, or to the holder of the equity of redemption if there are no inferior lienholders. See Mortgage & Trust Inc. v. Bonner & Co., 572 S.W.2d 344, 351 (Tex.Civ.App.-Corpus Christi 1978, writ ref. n.r.e.); Pearson v. Teddlie, 235 S.W.2d 757, 759 (Tex.Civ.App.Eastland 1950, no writ); RESTATEMENT (THIRD) OF PROPERTY: MORTGAGES, supra § 7.4; BAGGETT, supra; 4 RICHARD R. POWELL AND PATRICK J. ROHAN, POWELL ON REAL PROPERTY § 37.41 (1997). Surplus funds are not applied to satisfy a senior lien because the law presumes that the purchaser is aware of the senior lien and only pays for the property's *814 worth in excess of the prior debt. L. Jones, Jones On Mortgages § 2186 (1928). These basic principles reflect an intent to put the foreclosure purchaser into the shoes of the mortgagor at the time the foreclosed mortgage was executed. RESTATEMENT (THIRD) OF PROPERTY: MORTGAGES, supra § 7.1 cmt. a.
Appellant has not cited a single case, and we have found none, in which the trustee applied the surplus funds from a conventional junior lien foreclosure sale to the indebtedness secured by a senior lienin the absence of special circumstances, such as a specific agreement at the time of sale between the trustee and the purchaser. See Shaikh v. Burwell, 105 N.C.App. 291, 412 S.E.2d 924, 926-27 (N.C.App.1992, rev.denied); Kaplan v. Ruffin, 213 Va. 551, 193 S.E.2d 689, 693 (1973). To permit the approach suggested by appellant would contravene the well-established foreclosure principles set forth above. Conversion Properties purchased the property subject to the indebtedness secured by the first deed of trust. Accordingly, we hold that the trustee here had no authority to apply surplus funds to reduce the debt secured by the first deed of trust. There being no lien inferior to the foreclosed deed of trust, any surplus remaining from the sale after satisfying the Guaranty Federal note belongs to appellees as holders of the equity in redemption. We overrule appellant's first and second points of error.
In its third and fourth points of error, Conversion Properties contends that because it has paid a portion of the first lien indebtedness in order to protect its interest in the property and prevent the senior lienholder from foreclosing, it should be subrogated to the rights of the first lienholder as a matter of law. Conversion Properties further argues it is entitled to a judgment against the excess foreclosure proceeds to the extent of its payment of the prior indebtedness.
In support of its subrogation theory, appellant relies primarily on Schneider v. Sellers, 25 Tex.Civ.App. 226, 61 S.W. 541 (1900, writ dism'd), and Howard v. Stahl, 211 S.W. 826 (Tex.Civ.App.-Amarillo 1919, no writ). However, neither of these cases involves a foreclosure purchaser's entitlement to surplus funds as subrogee of a senior lienholder. Because we have already determined that the mortgagee through which Conversion Properties claims subrogation is not entitled to the surplus funds, we likewise conclude Conversion Properties's equitable subrogation theory is without merit.
Equitable subrogation is designed to prevent the unjust enrichment of a debtor who owed a debt that has been paid. World Help v. Leisure Lifestyles, Inc., 977 S.W.2d 662, 681 (Tex.App.-Fort Worth 1998, pet. denied). It is predicated upon principles of equity, and absent the requisite balancing of those equities, a party may not prevail on this theory. Houston Gen. Ins. v. Association Cas. Ins., 977 S.W.2d 634, 637 (Tex.App.-Tyler 1998, no pet.). After reviewing the facts of this case in light of the competing equities involved, we conclude Conversion Properties cannot use subrogation to gain access to surplus funds to which the underlying mortgagee would not be entitled.
Subrogation involves the substitution of one person for another regarding a lawful claim or right. See Cockrell v. Republic Mortgage Ins. Co., 817 S.W.2d 106, 113 (Tex.App.Dallas 1991, no writ). However, a subrogee obtains no greater rights than its subrogor. Id. As noted above, the senior lienholder had no right to the surplus proceeds generated by the foreclosure sale under the second deed of trust. To allow Conversion Properties to obtain these funds under a subrogation theory would directly contravene the above principle. In essence, Conversion Properties is seeking to recover from appellees a portion of the senior lien indebtedness that it did not take into consideration when it purchased the property at the foreclosure sale. Moreover, there is no evidence in the record that appellees would be unjustly *815 enriched if they received the surplus proceeds at issue. To the contrary, as the record owners of the property at the time of the foreclosure sale, they were entitled to the excess foreclosure proceeds as holders of the equity of redemption because the sale divested them of their title. On the other hand, by purchasing the property subject to the senior mortgage, Conversion Properties obtained an interest in the property no greater than that which appellees held. To allow Conversion Properties, now the owner of the property, to also recover the payments it has made on the senior indebtedness would place it in a better position than that previously occupied by the appellees and the mortgagee to which it claims to be subrogated. We will not apply an equitable doctrine to achieve such an inequitable result. We overrule Conversion Properties's third and fourth points of error.
In its fifth and sixth points of error, Conversion Properties asserts the trial court abused its discretion in awarding attorney's fees because the trial court erred in granting appellees' request for declaratory relief and denying appellant's. Having concluded the trial court did not err in its disposition of the cross motions for summary judgment, we find no abuse of discretion on the part of the trial court regarding the award of attorney's fees. We overrule appellant's fifth and sixth points of error.
We affirm the trial court's judgment.
NOTES
[1]  Although Conversion Properties contends it had no actual knowledge of the first deed of trust, it does not contend that it lacked constructive knowledge of the first deed of trust. Conversion Properties does not allege the first deed of trust was improperly recorded or would have been undiscoverable through a proper title search.
