
144 S.W.3d 600 (2004)
TML INTERGOVERNMENTAL EMPLOYEE BENEFITS POOL, Appellant,
v.
PRUDENTIAL INSURANCE COMPANY OF AMERICA, Appellee.
No. 03-03-00605-CV.
Court of Appeals of Texas, Austin.
May 13, 2004.
Rehearing Overruled June 10, 2004.
*602 Catherine Brown Fryer, Bickerstaff, Heath, Smiley, Pollan, Kever & McDaniel, LLP, Austin, for appellant.
Steven R. Shaver and Rebecca M. Alcantar, Wilson, Elser, Moskowitz, Edelman & Dicker, LLP, Dallas, for appellee.
Before Chief Justice LAW, Justices PATTERSON and PURYEAR.

OPINION
JAN P. PATTERSON, Justice.
In this case we must decide whether, when a governmental entity brings suit for declaratory relief, the defendant as the prevailing party may recover attorney's fees from the governmental entity. Appellant TML Intergovernmental Employee Benefits Pool ("the Pool") contends in one issue that governmental immunity bars the award of attorney's fees to appellee Prudential Insurance Company of America. *603 Because we hold that the Pool's initiation of suit waived immunity from suit and that its request for declaratory relief under the Uniform Declaratory Judgments Act ("UDJA") waived immunity from liability for attorney's fees, we affirm the order of the district court.

BACKGROUND
The pertinent facts of this case are not in dispute. The Pool was created to provide health benefits coverage to employees of political subdivisions. See Tex. Gov't Code Ann. ch. 791 (West 1994 & Supp.2004); Tex. Loc. Gov't Code Ann. ch. 172 (West 1999 & Supp.2004). On September 29, 1998, the City of Denison changed its health benefits coverage for its employees from Prudential to the Pool. Prudential's contract with the City provided for an extension of health care benefits beyond the termination of the contract, for a maximum of three months, to a person who is totally disabled and under a doctor's care.
At the time of this transition in coverage, an employee of the City of Denison was hospitalized and in need of a heart transplant. She remained hospitalized for several months and received the transplant in April 1999. Both Prudential and the Pool paid the employee's medical expenses for the last three months of 1998. The Pool filed a claim for its payments with its excess loss insurance coverage carrier, Life Insurance Company of North America ("LINA"). See Tex. Loc. Gov't Code Ann. § 172.008(a) (West 1999) ("A risk pool may purchase excess loss coverage or reinsurance to insure a pool against financial losses that the pool determines might place the solvency of the pool in financial jeopardy."). LINA denied the claim.
In January 2001, the Pool filed suit against LINA and Prudential, asserting that LINA had breached its contract and requesting a declaration that the extension of benefits clause in Prudential's policy with the City "does not provide insurance coverage for [the employee's] claim." The Pool also sought attorney's fees pursuant to its request for declaratory relief. At the time it filed suit, the Pool deposited into the registry of the court approximately $348,000 that the hospital returned as an overpayment. In June and August 2001, the parties agreed to distribute $220,000 to the hospital and the remaining $128,000 to Prudential, which represented the amount that Prudential paid toward the employee's medical expenses for the last three months of 1998.
In February 2002, the Pool filed an amended petition, requesting a declaration of whether Prudential's policy "does or does not provide insurance coverage for [the employee's] claim." Prudential then filed a motion for summary judgment, seeking a declaration that its policy does not provide coverage. The Pool and LINA filed motions for partial summary judgment seeking a declaration that Prudential's policy does provide coverage. In June 2002, Prudential filed an amended answer in which it asserted a claim for attorney's fees pursuant to the UDJA. Tex. Civ. Prac. & Rem.Code Ann. § 37.009 (West 1997).
The district court granted Prudential's motion for summary judgment and denied the Pool's and LINA's motions. Soon afterward, Prudential filed a motion to recover attorney's fees from the Pool on the ground that it was the prevailing party in the declaratory judgment action. The Pool responded that as a political subdivision of the State, it is immune from liability. The Pool also asserted that because it had acted in good faith, the district court should exercise its discretion and not award attorney's fees. Prudential responded that the Pool waived immunity from liability by seeking a declaration of *604 its rights under the UDJA, initiating suit against Prudential, and failing to plead the affirmative defense of immunity from liability. After a hearing on the motion and response, the district court granted Prudential's motion and ordered that the Pool pay Prudential's attorney's fees in part. It is from this order that the Pool appeals.[1]

ANALYSIS
In one issue, the Pool contends that the district court erred in awarding attorney's fees to Prudential under the UDJA because the Pool, as a political subdivision, is immune from paying a money judgment. Whether the Pool is entitled to immunity is a question of law. Harris County v. Louvier, 956 S.W.2d 106, 107 (Tex.App.-Houston [14th Dist.] 1997, no pet.). We review questions of law de novo. Texas Dep't of Transp. v. Needham, 82 S.W.3d 314, 318 (Tex.2002). In our analysis of this issue, we are mindful of two matters that are not in dispute. First, the parties agree the Pool's UDJA action was within the district court's subject matter jurisdiction. Second, the parties agree that Prudential prevailed on the merits of the Pool's action for declaratory relief.
Governmental immunity encompasses two principles: immunity from suit and immunity from liability. Texas Natural Res. Conservation Comm'n v. IT-Davy, 74 S.W.3d 849, 853 (Tex.2002). The Pool asserts immunity on both grounds, and we will address them individually. Immunity from suit bars a suit against the State unless the legislature expressly consents to the suit. Id. An exception to this rule is when the State initiates suit. Id. at 861 (Hecht, J., concurring) ("[I]t has long been held that the State can waive immunity by filing suit."); State v. Fidelity & Deposit Co. of Md., 127 S.W.3d 339, 344 (Tex.App.-Austin 2004, pet. filed) ("It is well established that the State's initiation of suit is an exception to sovereign immunity from suit clearly recognized by Texas courts."). When a governmental entity brings suit, it "waives immunity from suit for any claim that is `incident to, connected with, arises out of, or is germane to the suit or controversy brought by the State.'" Reata Constr. Corp. v. City of Dallas, 47 Tex. Sup.Ct. J. 408, ___ S.W.3d ___, ___, 2004 WL 726906, at * 3, 2004 Tex. LEXIS 303, at * 7 (Apr. 2, 2004) (quoting State v. Martin, 347 S.W.2d 809, 814 (Tex.Civ.App.-Austin 1961, writ ref'd n.r.e.)). Here, the Pool asserted, among its causes of action, a request for declaratory relief. In response, Prudential requested attorney's fees under the UDJA. This request is directly germane to the controversy brought by the Pool. Accordingly, when the Pool brought a declaratory-judgment action against Prudential, it waived immunity from suit as to Prudential's request for attorney's fees under the same statute. See Kinnear v. Texas Comm'n on Human Rights, 14 S.W.3d 299, 300 (Tex.2000) (no immunity from suit when defendant sought attorney's fees as consequence of suit by the State). We now turn to the question of immunity from liability for attorney's fees available under the UDJA.
Immunity from liability protects a governmental entity from judgment even if the legislature has expressly consented to the suit. Texas Dep't of Transp. v. Jones, 8 S.W.3d 636, 638 (Tex.1999). "[T]he question remains whether the claim is one for which the State acknowledges liability." Federal Sign v. Texas S. Univ., 951 S.W.2d 401, 405 (Tex.1997) (citing State v. Isbell, 127 Tex. 399, 94 S.W.2d 423, 425 (1936)). Immunity from liability, as with other affirmative defenses to liability, must be pled or is waived. Jones, 8 *605 S.W.3d at 638. Prudential asserts on two grounds that the Pool has waived immunity from liability. First, Prudential argues, the Pool waived immunity from liability by seeking construction of (i) a provision in Prudential's insurance contract with the City of Denison and (ii) certain statutory provisions. It is true that when the State contracts with a private party, it waives immunity from liability. IT-Davy, 74 S.W.3d at 854. This principle is inapplicable here because the suit does not concern any contract between the Pool and Prudential. Furthermore, although the Pool cited statutory provisions in some of its pleadings, at no point did the Pool seek a declaration of its rights under those statutes. Its declaratory judgment action was limited to interpretation of a provision in Prudential's insurance contract with the City of Denison.
Second, Prudential contends that the Pool waived immunity from liability by failing to raise its affirmative defense in a pleading. Citing Davis v. City of San Antonio, Prudential argues specifically that the Pool's assertion of the affirmative defense in its response to Prudential's motion for attorney's fees was insufficient. 752 S.W.2d 518 (Tex.1988). In Davis, the governmental entity failed to raise the affirmative defense until after the case was tried to a verdict. Id. at 519. The court held that raising the defense in a motion for judgment notwithstanding the verdict did not comply with the requirement that an affirmative defense be raised "in a pleading to a preceding pleading." Id. (citing Tex.R. Civ. P. 94). Here, Prudential first requested attorney's fees in an amended answer. Thus, it argues, the Pool's assertion of its affirmative defense in response to its later motion for attorney's fees was too late. We disagree. Prudential asks us to interpret "in a pleading to a preceding pleading" to mean "in a pleading immediately responsive to a preceding pleading." The Pool's assertion of the defense in response to Prudential's motion was sufficient to satisfy the requirement of raising the defense "in a pleading to a preceding pleading" and put Prudential and the court on notice of the defense before the hearing on Prudential's motion for attorney's fees. Accordingly, we find no waiver on these grounds. We now turn to an examination of whether the Pool's request for declaratory relief waived its immunity from liability for attorney's fees under the UDJA. This requires us to apply principles of statutory construction.
When construing a statute, we must ascertain and give effect to the legislature's intent. See Fleming Foods v. Rylander, 6 S.W.3d 278, 284 (Tex.1999); Union Bankers Ins. Co. v. Shelton, 889 S.W.2d 278, 280 (Tex.1994); Calvert v. Texas Pipe Line Co., 517 S.W.2d 777, 780 (Tex.1974). The legislature's intent should be determined by reading the language used in the particular statute and construing the statute in its entirety. See In re Bay Area Citizens Against Lawsuit Abuse, 982 S.W.2d 371, 380 (Tex.1998); Taylor v. Firemen's & Policemen's Civil Serv. Comm'n, 616 S.W.2d 187, 190 (Tex.1981). Further, we should read every word, phrase, and expression in a statute as if it were deliberately chosen, and presume the words excluded from the statute are done so purposefully. See Gables Realty Ltd. P'ship v. Travis Cent. Appraisal Dist., 81 S.W.3d 869, 873 (Tex.App.-Austin 2002, pet. denied); City of Austin v. Quick, 930 S.W.2d 678, 687 (Tex.App.-Austin 1996) (citing Cameron v. Terrell & Garrett, Inc., 618 S.W.2d 535, 540 (Tex.1981)), aff'd, 7 S.W.3d 109 (Tex.1999).
The Pool asserts that immunity from liability is waived only when a UDJA action concerns construction of a legislative enactment. See City of La Porte v. Barfield, *606 898 S.W.2d 288, 297 (Tex.1995) (because UDJA "expressly authorizes suits to challenge ordinances and statutes, requires that the responsible government entities be joined as parties, and provides for awards of attorney fees, the Act necessarily waives immunity from liability for such awards") (construing Texas Educ. Agency v. Leeper, 893 S.W.2d 432, 446 (Tex.1994)); see also Beacon Nat'l Ins. Co. v. Montemayor, 86 S.W.3d 260, 266 (Tex.App.-Austin 2002, no pet.) ("The UDJA waives [sovereign] immunity when a party seeks a court's construction of a statute or rule."); Star Houston, Inc. v. Texas Dep't of Transp., 957 S.W.2d 102, 111 (Tex.App.-Austin 1997, pet. denied) (holding that sovereign immunity did not bar declaratory-judgment action determining whether agency has wrongfully construed a statute). But none of these cases expressly restrict the waiver to actions seeking construction of legislative enactments. Further, all of these cases involved actions by private parties against a governmental entity.
Here, the governmental entity asserted the action. The supreme court has allowed an award of attorney's fees to a defendant in a UDJA action brought by a governmental entity, although the issue of immunity from liability was not before the court. Duncan v. Pogue, 759 S.W.2d 435, 435 (Tex.1988). In Duncan, a court reporter sued a county to compel a salary increase; the county filed a counterclaim under the UDJA. Id. The court upheld the award of attorney's fees to the court reporter, explaining, "[T]he trial judge acted within his discretion in awarding attorney fees to Duncan. The [UDJA] expressly provides that `the court may award costs and reasonable and necessary attorney's fees as are equitable and just.'" Id. at 435-36 (citing Tex. Civ. Prac. & Rem.Code Ann. § 37.009). Our question then is whether, when the issue of immunity from liability is expressly raised before the court, the governmental entity is protected from paying a judgment for attorney's fees awarded under the UDJA.
Embedded in the sovereign immunity doctrine is the protection of raids on the public treasury. Texas Mun. Power Agency v. Public Util. Comm'n, 100 S.W.3d 510, 516 (Tex.App.-Austin 2003, pet. denied). We must determine whether allowing an award of attorney's fees to a defendant in a UDJA action brought by a governmental entity would thwart that purpose. The supreme court recently stated in the context of waiver of immunity from liability: "Our decisions recognizing a waiver of immunity have generally left undisturbed the Legislature's interest in protecting the State's financial resources." Wichita Falls State Hosp. v. Taylor, 106 S.W.3d 692, 701 (Tex.2003).
The purpose of the UDJA is "to settle and to afford relief from uncertainty and insecurity with respect to rights, status, and other legal relations." Tex. Civ. Prac. & Rem.Code Ann. § 37.002(b) (West 1997). The UDJA is to be "liberally construed and administered." Id. The Pool, as a party whose rights were affected by the contract, asserted a UDJA action to determine whether a provision in Prudential's insurance contract with the City of Denison provided extended benefits coverage for the employee's claim. Id. § 37.004(a) (West 1997). The Pool had an interest in this determination because it succeeded Prudential as the provider of health benefits coverage. "When declaratory relief is sought, all persons who have or claim any interest that would be affected by the declaration must be made parties." Id. § 37.006(a) (West 1997). Thus, even though the Pool's actions for damages were against its excess loss insurance carrier, the Pool was required to include Prudential *607 as a party affected by the declaration.
In "any proceeding" under the UDJA, "the court may award costs and reasonable and necessary attorney's fees as are equitable and just." Id. § 37.009 (emphasis added). The UDJA "entrusts attorney fee awards to the trial court's sound discretion, subject to the requirements that any fees awarded be reasonable and necessary, which are matters of fact, and to the additional requirements that fees be equitable and just, which are matters of law." Bocquet v. Herring, 972 S.W.2d 19, 21 (Tex.1998). "Unreasonable fees cannot be awarded, even if the court believed them just, but the court may conclude that it is not equitable or just to award even reasonable and necessary fees." Id. Further, the award of attorney's fees is not dependent on a finding that the party "substantially prevailed." Barshop v. Medina County Underground Water Conservation Dist., 925 S.W.2d 618, 637 (Tex.1996). Instead, a trial court may award attorney's fees to a non-prevailing party as are equitable and just. State Farm Lloyds v. Borum, 53 S.W.3d 877, 894 (Tex.App.-Dallas 2001, pet. denied). Thus, the attorney's fees provision grants the trial court broad discretion to (i) afford all parties the opportunity to request fees; (ii) decline to award fees; and (iii) allow an award only when reasonable, necessary, equitable, and just. In granting the trial court broad discretion, the UDJA also allows the court to take into consideration the protection of state resources.
To hold that a governmental entity, as plaintiff in a UDJA action, is immune from liability as to a prevailing defendant's attorney's fees would give governmental entities license to pursue UDJA actions with impunity and disregard the statutory authorization for attorney's fees in "any proceeding" under the UDJA. Tex. Civ. Prac. & Rem.Code Ann. § 37.009. Here, the parties agree that the district court has subject matter jurisdiction. In light of the policies of and protections embodied in the UDJA, we hold that when a governmental entity brings suit for declaratory relief, the UDJA waives immunity from liability as to the defendant's reasonable, necessary, equitable, and just attorney's fees. Accordingly, we overrule the Pool's issue and affirm the order of the district court.

CONCLUSION
When the Pool brought an action for declaratory relief against Prudential, it waived immunity from suit as to Prudential's request for attorney's fees under the same statute. See Kinnear, 14 S.W.3d at 300 (no immunity from suit when private party sought attorney's fees as consequence of suit by the State). The attorney's fees provision in the UDJA waives immunity from liability by allowing awards of attorney's fees in "any proceeding" and ensuring that a court may award fees only when reasonable, necessary, equitable, and just. Accordingly, we overrule the Pool's assertion of governmental immunity and affirm the order of the district court.
NOTES
[1]  LINA is no longer a party because it settled with the Pool in the proceedings below.
