
243 S.W.3d 117 (2007)
Jonathan D. MITCHELL and Terry L. Mitchell, Appellants,
v.
FORT DAVIS STATE BANK, Appellee.
No. 08-06-00043-CV.
Court of Appeals of Texas, El Paso.
August 30, 2007.
*119 Robert R. Truitt, Jr., Midland, TX, for Appellant.
James W. Brewer, Ken Slavin, Kemp Smith, P.C., El Paso, TX, for Appellee.
Before CHEW, C.J., McCLURE, and CARR, JJ.

OPINION
ANN CRAWFORD McCLURE, Justice.
Jonathan and Terry Mitchell challenge a summary judgment granted in favor of the Fort Davis State Bank. At issue is the validity of the Bank's lien on the Mitchells' property in Marathon, Texas. For the "following reasons, we affirm.

FACTUAL SUMMARY
In 1991, Jonathan Mitchell purchased eight and one half acres in Marathon known as Tract 13. The next year, Jonathan began construction of the family home. The Mitchells moved onto the property in 1993 and lived in a mobile home as the house was completed. In the mid-1990's, Jonathan began construction of four buildings for his business known as Mitchells' Furniture Warehouse. The *120 business filed an assumed name certificate as a retail furniture and auto sales business.
The Mitchells, d/b/a Mitchell's Furniture Warehouse, obtained a Small Business Administration loan from the Bank in the amount of $680,000. The loan was used to purchase inventory, to pay outstanding debt to the Bank, and to provide working capital. As security for the loan, the Mitchells executed a deed of trust that gave the Bank a lien on the northern half of Tract 13. The deed of trust described the property as:
A 4.524-acre tract, more or less, out of the North half (N/2) of Tract 13, BURNHAM SUBDIVISION, Marathon, Brewster County, Texas, out of Section 18, Block 4, G.C. & S.F. Ry. Co. Survey, Brewster County, Texas as described in Vol. 24, Pg. 312, Official Public Records of Brewster County, Texas.
Grantor represents to Beneficiary that no part of the property is either the residential or business homestead of Grantor and that Grantor neither does nor intends to reside in or conduct business on the property. Grantor renounces all present and future rights to a homestead exemption for the property. Grantor's homestead and residence is located on a 4.137 acre tract out of the S/2 of Tract 13, BURNHAM SUBDIVSION, more particularly described in the `Designation of Homestead and Affidavit of Non-Homestead' attached hereto and incorporated by reference herein.
Both Jonathan and Terry signed the Designation of Homestead and Affidavit of Non-Homestead, which stated:
`That we, JONATHAN D. MITCHELL and TERRY L. MITCHELL (`Affiants'), of the County of Brewster, State of Texas, have this day set apart and designated, and by these presents do set apart and designate, as the homestead claimed by us, and which our family is entitled to under the Texas Constitution and laws of the State of Texas, exempt from forced sale, the following described property which we now own, use and occupy and upon which we now live and reside, to-wit:
A 4.137-acre tract, more or less, out of the South half (S/2) of Tract 13, BURNHAM SUBDIVISION, Marathon, Brewster County, Texas, out of Section 18, Block 4, G.C. & S.F. Ry. Co. Survey, Brewster County, Texas, as described in Vol. 24, Pg. 312, Official Public Records of Brewster County, Texas.'
Affiant on oath swears that the following statements are true:
`Affiant relinquishes all homestead claims that Affiant might have under the Texas Constitution or other laws of the State of Texas to all other property owned by Affiant or in which Affiant may have an interest. Affiant disclaims all homestead right, interest, and exemption related to our nonhomestead property, including the following described real property located in Brewster County, Texas, to-wit:
A 4.524-acre tract, more or less, out of the North half (N/2) of Tract 13, BURNHAM SUBDIVISION, Marathon, Brewster County, Texas, out of Section 18, Block 4, G.C. & S.F. Ry. Co. Survey, Brewster County, Texas as described in Vol. 24, Pg. 312, Official Public Records of Brewster County, Texas.'
`We further declare that this Homestead Designation and Affidavit of Nonhomestead is being made by us for the purpose of inducing FORT DAVIS STATE BANK, hereinafter called `Lender', to make a loan in the amount of $680,000.00 to us. We are aware of the legal consequences of fraudulent inducement *121 to lend money. We understand this Affidavit shall be relied upon by said Lender in order to make a loan to us.'
In December 2002, the Mitchells filed for bankruptcy under Chapter 7. Among other items, they claimed "4 acres and house, 207 Airport Rd., Marathon, Texas" and "4 acres and metal building" as exempt property in their bankruptcy forms.[1] The Bank sought relief from the bankruptcy stay, claiming its lien on the northern half of the property and its intent to foreclose on the lien. The Mitchells did not object to the Bank's motion. The bankruptcy court granted the motion and lifted the stay. In the order; the court specifically found that the Bank held a valid and perfected lien on the northern 4.524 acre tract. The Bank foreclosed on the deed of trust lien; the Mitchells received notice of the foreclosure, but they did not challenge or otherwise try to prevent the sale.
The Mitchells later filed suit against the Bank seeking a declaratory judgment that the Bank's claim, lien, and purported foreclosure were void, They also filed suit to quiet title and to recover damages for the violation of their homestead rights. In response, the Bank pled the affirmative defenses of res judicata and judicial estoppel, contending the validity of the lien was adjudicated during the bankruptcy proceedings, and the Mitchells were estopped from claiming homestead. The Bank also alleged the Mitchells had waived their homestead rights in the property. Because the Mitchells had asserted a claim for declaratory relief, the Bank sought reasonable and necessary attorney's fees.[2]
Both the Mitchells and the Bank filed motions for summary judgment.[3] The trial court denied the Mitchells' claims and granted summary judgment for the Bank. The court found the lien was valid as to the 4.524 acres in the northern half of the tract. The Mitchells were ordered to pay attorney's fees of $5,000, plus costs in the amount of $399.

VALIDITY OF LIEN
When both sides move for summary judgment and the trial court grants one motion and denies the other, we review both motions and determine all questions presented. FM Properties Operating Co. v. City of Austin, 22 S.W.3d 868, 872 (Tex. 2000). Where the trial court does not specify the grounds upon which summary judgment is granted, we must affirm if any of the grounds are meritorious. Id.
The Bank claimed it was entitled to summary judgment based on the affirmative defenses of res judicata and judicial estoppel. The movant must carry the burden of establishing there is no genuine issue of material fact and that judgment should be granted as a matter of law. Southwestern Elec. Power Co. v. Grant, 73 S.W.3d 211, 215 (Tex.2002); Edwards v. Mesa Hills Mall Co. Ltd. Partnership, 186 *122 S.W.3d 587, 590 (Tex.App.-El Paso 2006, no pet.). A defendant seeking summary judgment based on an affirmative defense must conclusively prove all of the elements of the affirmative defense. KPMG Peat Marwick v. Harrison County Housing Finance Corp., 988 S.W.2d 746, 748 (Tex. 1999). We must assume all of the evidence favorable to the non-movant is true, indulge every reasonable inference in favor of the non-movant, and resolve any doubts in favor of the non-movant. Edwards, 186 S.W.3d at 590.

Res Judicata
The Bank alleged the Mitchells were barred by the doctrine of res judicata from denying the validity of the lien since the subject of the bankruptcy court's order was the validity and enforceability of the lien, and an order from the bankruptcy court lifting the automatic stay is a final appealable order. Because the issue is whether the federal bankruptcy court order bars the Mitchells' claims in state court, the federal law of res judicata controls. Geary v. Texas Commerce Bank, 967 S.W.2d 836, 837 (Tex.1998) (since bankruptcy is a federal proceeding, federal law controls whether res judicata will bar a later state court proceeding). Under federal law, res judicata bars the litigation of claims that either have been litigated or should have been raised in an earlier suit. In re Southmark Corp., 163 F.3d 925, 934 (5th Cir.1999). Res judicata requires four elements: (1) parties who are identical or in privity; (2) the judgment in the prior action was rendered by a court of competent jurisdiction; (3) the prior action was concluded to a final judgment on the merits; and (4) the same claim or cause of action was involved in both actions. Id. In determining whether the actions involved the same claim or the same cause of action, the Fifth Circuit has adopted the transactional test of the Restatement (Second) of Judgments, § 24. Id. The fourth element is met if the two actions are based on "the same nucleus of operative facts." Id.

Jurisdiction and Same Parties
Neither party claims the bankruptcy court lacked jurisdiction to lift the stay. Both the Mitchells and the Bank were parties to the bankruptcy proceeding. Thus, the first two elements are satisfied.

Final Judgment on the Merits
According to the Mitchells, the contested matter in the Bank's effort to lift the stay did not address the validity of the lien.[4] They also argue the validity of the lien should have been brought through an adversary proceeding.
[4] There are two different forms of adversary process within a bankruptcy case: contested matters and adversary proceedings. D-1 Enterprises, Inc. v. Commercial State Bank, 864 F.2d 36, 39 (5th Cir.1989). A contested matter is a quick motion and hearing procedure that provides for expedited relief from an automatic stay. See id. at 38-39. An adversary proceeding requires the service of summons and is also used to determine the validity of a lien. Fed.Bankr.Proc.R. 7001 and 7002.
The Mitchells rely on Pemelton for their argument that the validity of a lien is not an issue in a contested matter.[5]See Pemelton *123 v. Russell Trusts Partnership, 913 S.W.2d 710 (Tex.App.-Corpus Christi 1995, no pet.)There, the debtor filed for Chapter 12 bankruptcy and Russell, a secured creditor, was granted relief from stay. Id. at 711-12. Russell then filed suit in state court to foreclose on its vendor's lien and summary judgment was granted in its favor on the basis that res judicata barred Pemelton from contesting the foreclosure. Id. at 712. The Corpus Christi Court of Appeals held the bankruptcy court's order lifting the stay did not have the preclusive effect on Pemelton's defense against foreclosure since the court did not adjudicate the merits of Russell's claims. Id. at 713.
Pemelton is distinguishable for three reasons. First, the creditor's suit seeking judicial foreclosure was filed while the bankruptcy suit was still pending. Id. Here, the Mitchells filed their suit seeking declaratory judgment and trespass to try title after their debts were discharged by the bankruptcy court and after the Bank had foreclosed.
Secondly, the Corpus Christi court relied upon an opinion from the First Circuit for its position that a decision to lift a stay is not an adjudication of the validity of a claim. Grella v. Salem Five Cent Say. Bank, 42 F.3d 26, 35 (1st Cir.1994). Grella held that a determination made at a motion for relief hearing is not an adjudication as to the merits of a creditor's claim or any possible defense or counterclaims.[6] Id. But the Fifth Circuit has held that an unrelated claimsuch as lender liability is not barred by res judicata because it is not a direct defense that the debtor could or should have litigated in response to the creditor's motion for relief from stay. D-1 Enterprises, 864 F.2d at 39. Thus, a debtor's direct defense that could and should have been litigated in response to a creditor's motion to lift the stay would be precluded by the application of res judicata. See D-1 Enterprises, 864 F.2d at 39.
Third, the Corpus Christi Court of Appeals has since applied D-1 Enterprises. See Ford v. City State Bank of Palacios, 44 S.W.3d 121 (Tex.App.-Corpus Christi 2001, no pet.). There, Ford filed for bankruptcy to discharge several delinquent bank loans. When the bank sought relief from the automatic stay, the bankruptcy judge signed an order continuing the stay on the condition that Ford make timely payments to the trustee. Ford failed to make the first payment. The stay was lifted and Ford moved for voluntary dismissal of his bankruptcy action on December 12, 1997. One month later, Ford filed a lender liability suit in state court, alleging violations of the Texas Debt Collection Practices Act and the Texas Deceptive *124 Trade Practices Act and later added causes of action for breach of contract, promissory estoppel, detrimental reliance, and fraud. The bank's motion for summary judgment was granted. At issue on appeal was the critical question of whether the bankruptcy court's order conditionally continuing the automatic stay was a final judgment on the merits. Relying upon D-1 Enterprises, the court differentiated between direct and indirect defenses.
[T]he courts have held that `indirect defenses,' such as breach of contract, fraud and the like, would be severed from the expedited stay litigation if raised in an effort to defeat the creditor's motion. The lender liability claims asserted in the adversary proceeding at issue in this case were not, under the foregoing analysis, `direct defenses' that the debtor could or should have litigated in response to the creditor's motion for relief from the stay. Hence they are not precluded by the application of res judicata.
Ford, 44 S.W.3d at 132. For the reasons stated, we decline to follow Pemelton.
Finally, the Mitchells contend the validity of the lien should have been challenged through an adversary proceeding. Neither party in this case sought an adversary. proceeding to determine the validity of the lien.[7] Rather, the only determination made regarding the validity of the lien was expressly given by the bankruptcy court in its order granting the Bank's motion for relief. Although the lien's validity was not determined through an adversary proceeding, the Fifth Circuit has held that what is essential to the application of res judicata is the principle that the previously unlitigated claim to be precluded could and should have been brought in the earlier litigation. D-1 Enterprises, 864 F.2d at 38. In addition, the nature of the proceeding does not automatically determine whether an action is barred by res judicata. See In re Intelogic Trace, Inc., 200 F.3d 382, 389 (5th Cir.2000); In Re Howe, 913 F.2d 1138, 1147 n. 28 (5th Cir. 1990) ("We do not intimate . . . whether a proceeding sought to be given res judicata effect is an adversary proceeding or a contested matter . . . [t]he critical question . . . is whether the party could or should have asserted the claim in the earlier proceeding.").
While the validity of a lien may be challenged in an adversary proceeding, neither party here instituted such proceedings. The bankruptcy court determined the issue of the validity of the lien as a contested matter and specifically determined that the bank had a valid and perfected lien. Having made this determination, the bankruptcy court's order was a judgment on the merits. An order granting relief from an automatic stay is a final and appealable order. In re Chunn, 106 F.3d 1239, 1242 (5th Cir.1997). Since the Mitchells did not appeal the order, it became a final judgment.

Same Claim or Cause of Action in Both Actions
We next examine the critical issue of whether the Mitchells' present claim *125 that the Bank did not possess a valid lien is or could be based on the "same nucleus of operative facts" as the Bank's motion to lift the stay. Essential to the application of res judicata is the principle that the previously unlitigated claim could and should have been brought in the earlier litigation. D-1 Enterprises, 864 F.2d at 38. Largely unrelated matters or "indirect defenses" are not to be asserted in response to a creditor's motion for relief from stay and will not be barred by res judicata. See id. at 39. But a debtor's "direct defense" that can or should be raised is among the claims that will be precluded by res judicata. See id. at 39 (lender liability claims asserted in adversary proceeding at issue were not direct defenses that debtor could or should have litigated in response to the creditor's motion for relief from stay).
The Bank based its motion on 11 U.S.C. § 362(d)(1) and (2). Sections 362(d)(1) and (2) provide:
On request of a party in interest and after notice and a hearing, the court shall grant relief from the stay provided under subsection (a) of this section, such as by terminating, annulling, modifying, or controlling such stay
(1) for cause, including the lack of adequate protection of an interest in property of such party in interest;
(2) with respect to a stay of an act against property under subsection (a) of this section, if
(A) the debtor does not have an equity in such property; and
(B) such property is net necessary to an effective reorganization.
The trial court did not specify upon which ground the order was granted.
To make a prima facie case for relief under Section 362(d)(1), a movant must demonstrate that it holds a claim; secured by a valid, perfected lien upon estate property; and that a decline in the value of its collateral is either occurring or is threatened, against which the creditor is precluded from protecting its interests due to the existence of the automatic stay. In re Self, 239 B.R. 877, 881 (Bankr.E.D.Tex. 1999). To establish a prima facie case under Section 362(d)(2), a movant must demonstrate the amount of its claim, that its claim is secured by a valid, perfected lien in property of the estate, and that the debtor lacks equity in the property. In re Kowalsky, 235 B.R. 590, 594 (Bankr. E.D.Tex.1999). To be entitled to relief, the Bank was required to make a prima facie showing that it held a valid and perfected lien.
Since the burden was placed upon the Bank to establish its perfection and validity in the lien, the Mitchells had the burden to demonstrate that the Bank's lien was unperfected or invalid. See 11 U.S.C. § 362(g)(1) & (2) (in a hearing concerning relief from stay, the movant bears the burden of proof on the issue of the debtor's equity in property; and the non-movant has the burden of proof on all other issues). Here, the Mitchells did not object to the Bank's motion,[8] and they chose not to appeal. They cannot now collaterally attack the validity of the Bank's lien.
Bankruptcy courts have jurisdiction to hear and determine all cases under Title 11 and all core proceedings. See 28 U.S.C. § 157(b)(1). A motion to terminate, annul, or modify an automatic stay, as well as *126 determinations regarding the validity of liens, are core proceedings that should be brought before bankruptcy courts. See id. at § 157(b)(2)(G) & (K). Because a challenge to the validity of the lien could have and should have been raised before the bankruptcy court, the doctrine of res judicata precludes the Mitchells from raising the defense in the state district court. Since the trial court did not err in granting summary judgment on the basis of res judicata, we need not address the issue of judicial estoppel. Issue Two is overruled.
Nor did the trial court err in denying the Mitchells' cross-motion for summary judgment. In their motion, the Mitchells sought a declaration that the Bank's lien and foreclosure were illegal and void. Because our analysis of this issue is identical to our discussion of Issue Two, we overrule Issues One and Three.

ATTORNEYS' FEES
We must next determine whether the trial court properly awarded attorneys' fees in the amount of $5,000. In their fourth issue, the Mitchells contend the trial court erred in awarding fees because the award was given in the summary judgment context and the fees were controverted by their attorney's affidavit creating a fact issue.
The Mitchells sought a declaratory judgment in their original petition. Under the Uniform Declaratory Judgments Act, a trial court may award costs and reasonable and necessary attorney's fees that are equitable and just. Tex.Civ. Prac. & Rem.Code Ann. § 37.002(a) & 37.009. The "Act does not require an award, of attorney fees to the prevailing party." Bocquet v. Herring, 972 S.W.2d 19, 20 (Tex.1998). Since the trial court is not required to award fees, an award is within the trial court's discretion. Id. We must determine whether the trial court abused its discretion by awarding fees when there was insufficient evidence that the fees were reasonable and necessary, or when the award was inequitable or unjust. Heritage Resources, Inc. v. Hill, 104 S.W.3d 612, 618 (Tex.App.-El Paso 2003, no pet.). There are four limitations to the trial court's discretion: the fees must be reasonable and necessary, which are matters of fact; and the award must be equitable and just, which are matters of law. Id., citing Bocquet, 972 S.W.2d at 21.
The trial court does not abuse its discretion by the mere fact that an appellate judge under similar circumstances would have decided the matter in a different manner. Id. Rather, a trial court abuses its discretion only if it acts without reference to guiding legal rules and principles, or, stated differently, its decision is arbitrary or unreasonable. Id. Here, the Bank alleged that preclusive affirmative defenses clearly barred the Mitchells' declaratory judgment claim and that the Bank was required to incur substantial expenses in defending the claim. In support of its fee request, the Bank attached the affidavit of James W. Brewer. Brewster alleged the firm of Kemp Smith LLP had been retained by the Bank, had incurred fees and costs of $8,087.51, expenses of $399.51, and would incur an additional $1,800 in the prosecution of its motion for summary judgment. To justify the total request, Brewer identified all the attorneys and the paralegal who assisted with the case, the number of hours each attorney and paralegal worked on the case, and the cost per hour for each attorney and paralegal.
In response, the Mitchells attached the affidavit of their attorney, Robert Truitt. Truitt stated the following:
Further, approximately two weeks ago, I received from Mr. James W. Brewer documentation through a letter dated April 14, 2005 forwarding to me

*127 `Pursuant to your request for documentation of the Defendant's request for attorneys fees contained in its Defendant's Motion for Summary Judgment, enclosed are redacted copies of invoices evidencing fees and costs incurred.'
I have received these `redacted invoices,' which were dated March 12, 2004; April 7, 2004; May 14, 2004; June 16, 2004; July 12, 2004; August 9, 2004; and September 9, 2004 and find there to be missing a complete description of the work performed, a substantial amount of time spent in duplication of legal services, and apparently also unnecessary time and expense.
Therefore, in my professional opinion, the attorneys' fees and costs sought by Fort Davis State Bank in the amount of $8,087.51 and $1,800.00 are neither reasonable nor necessary, particularly as to the amount of $1,800 for prosecution of the motion for summary judgment, which is an estimate by Mr. Brewer, without any documentation provided for this figure.
The Mitchells argue that since they contested Brewer's affidavit, they raised a fact issue precluding summary judgment.
Despite the Bank's request for fees in the amount of $8,087.51 and $1,800, the trial court awarded $5,000. The Mitchells must show the fees were unreasonable or unnecessary. See Hill, 104 S.W.3d at 618. This they have failed to do. Because the trial court's award was within the range proven by the Bank, the trial court did not abuse its discretion. Issue Four is overruled. Having overruled all of all issues for review, we affirm the judgment of the trial court.
NOTES
[1]  In Schedule D, the Mitchells listed the secured creditor for the "4 acres and metal building" as the Small Business Administration and they listed the secured creditor for the "4 acres and house, 207 Airport Rd., Marathon, Texas" as Washington Mutual. Regarding the "4 acres and metal building," the Mitchells placed "X's" in the columns indicating that the secured creditor's claim was contingent, unliquidated, and disputed.
[2]  Section 37.009 of the Texas Civil Practice and Remedies Code provides, "In any proceeding under this chapter, the court may award costs and reasonable and necessary attorney's fees as are equitable and just." Tex. Civ. Prac. & Rem.Code Ann. § 37.009 (Vernon 1997).
[3]  The Bank's motion was based on the affirmative defenses of res judicata and judicial estoppel. The Mitchells' motion sought a declaration that the Bank's lien was void.
[4]  The bankruptcy court lifted the stay "after consideration of the pleadings, and finding that no objections were filed to the Motion and the time to object has expired."
[5]  The Mitchells also rely on several other Texas federal and state cases, all of which are distinguishable. See Ford v. City State Bank of Palacios, 44 S.W.3d 121, 130-32 (Tex.App.-Corpus Christi 2001, no pet.) (lender liability was not an issue actually litigated in bankruptcy proceeding); Flippin v. Wilson State Bank, 780 S.W.2d 457, 458-59 (Tex.App.-Amarillo 1989, writ denied) (bankruptcy court order confirming reorganization plan was res judicata and barred plaintiff's state court suit seeking to cancel deed of trust lien); In re Mathis, 64 B.R. 279, 280 & 284 (Bankr. N.D.Tex.1986) (case was a direct appeal from a motion to modify stay order where debtor challenged the validity of the note alleging the creditor changed the status of note from unsecured to secured and court judge specifically advised debtor to bring as adversary proceeding).
[6]  Grella is also significantly distinguishable for the following reasons: (1) the bankruptcy court order lifting the automatic stay did not make any findings as to the status of the bank's security interest in its notes; (2) the case was based on collateral estoppel, not res judicata; and (3) the trustee asserted a preference counterclaim, not a direct defense. Grella, 42 F.3d at 28-29, 31; see also Baskett v. Pleasant, 1996 WL 135680 at *8 n. 8 (Tex. App.-Dallas 1996, writ denied) (not designated for publication); Rios v. Town North National Bank, 1995 WL 375490 at *4 n. 1 (Tex.App.-Dallas 1995, writ denied) (not designated for publication).
[7]  During the summary judgment hearing, the trial court asked the Mitchells' attorney whether he could have raised an objection and converted the contested matter to an adversary matter. Counsel responded: "Your Honor, you don't convert a contested matter to an adversary matter or a motion for lift stay to an adversary matter. You actually. have to file a brand new lawsuit inside the bankruptcy court." The court then asked, "Well, couldn't you have done that?" Counsel answered, "Could we have done that? Yes, we could have, Your Honor. They could have done it too, Your Honor, if they wanted to clarify the issue of whether or not they had a valid lien. It could have been brought by either party. There is no burden on either party to necessary [sic] bring it."
[8]  The Mitchells contend that res judicata does not apply since they disclosed their property on Schedule A and claimed it as exempt on Schedule C. Although the Mitchells listed their property in the schedules, they did not allege the defense of homestead in opposition to the Bank's motion.
