
913 S.W.2d 701 (1995)
Ex parte Rachel CANTU,[1] Appellant.
No. 04-95-00640-CR.
Court of Appeals of Texas, San Antonio.
December 6, 1995.
Discretionary Review Refused March 6, 1996.
*702 Victor M. Valdes, San Antonio, for Appellant.
Steven C. Hilbig, Criminal District Attorney and Edward F. Shaughnessy, III, Assistant Criminal District Attorney, San Antonio, for Appellee.
Before CHAPA, C.J., and RICKHOFF and STONE, JJ.

OPINION
RICKHOFF, Justice.
This appeal questions our jurisdiction and raises double jeopardy concerns. Appellant, Rachel Santos Cantu, filed a special plea alleging that double jeopardy barred her criminal prosecution for injury to a child because she had been punished for that act by losing temporary custody of her children. The trial court accepted the motion as a writ of habeas corpus and denied relief. In two points of error, Cantu maintains the trial court erred in denying her requested relief because the U.S. and Texas double jeopardy clauses bar her criminal prosecution. The State contends that, despite the trial court's actions, Cantu's motion was a special plea over which we lack jurisdiction. We affirm because we find that a trial court may interpret a pleading as a writ of habeas corpus necessary to confer appellate jurisdiction and we further find that loss of child custody is not "punishment" for purposes of double jeopardy.

Summary of Facts
In 1991, the Texas Department of Protective and Regulatory Services investigated allegations that Cantu had physically and emotionally abused her son, Stephen. The agency gained temporary custody of Stephen and his sister, Heather, but reunited them with Cantu in May 1994.
In June 1994, the agency investigated whether Cantu had burned Stephen's legs *703 and buttocks with a hot iron. In a subsequent suit affecting the parent-child relationship (trial cause no. 94-PA-00811), the court appointed the agency as temporary managing conservator of the children and named Cantu as temporary possessory conservator with supervised visitation rights. Although the agency sought emergency relief for both children on the basis of the burning incident, the court made its findings "in the best interest of the children" without reference to other details.
On September 28, 1994, Cantu was indicted for causing bodily injury to Stephen by burning his legs and buttocks with a hot iron. On July 16, 1995, Cantu filed a written "Plea Bar and Motion to Dismiss Indictment," arguing that double jeopardy and collateral estoppel prevented the State from pursuing criminal charges after it punished her by taking custody of her children.
On August 1, 1995, the trial court held a hearing on Cantu's motion.[2] Defense counsel indicated he wanted to proceed "as a habeas corpus." The State did not object. The court replied:

I will consider the pleading as a Writ of Habeas Corpus, but I believe that the fact that you styled it as a Plea In Bar does not necessarily mean that it can't be treated that way. It basically means that if I give you an adverse ruling then you have a right to appeal it.
(emphasis added).
During the hearing, the court admitted into evidence the government's petition in the suit affecting the parent-child relationship and the corresponding temporary orders. After hearing Cantu's testimony and the argument of counsel, the court said:

Based upon the evidence I am going to deny your Writ of Habeas Corpus alleging double jeopardy and make specific findings. I will take judicial notice of the documents in cause number 94-CR-5804, which includes the indictment in this cause and the action in cause number 94-PA-00811. I have reviewed and I find that there has not been a permanent termination of parental rights which would constitute the equivalent of a forfeiture or a taking, and therefore there has not been a sufficient showing to invoke the protections of the Texas Constitution and the United States Constitution which prohibits being prosecuted or punished for the same offense twice. I am cognizant of the case law that has stated that forfeitures, where there has been the taking of property, will in some instance bar prosecution for the criminal offense. In this case I find no taking equivalent to that nature. This is a temporary lack of access to the children. She does have visitation rights and at this time I find that the writ is, if anything, premature. If there is a permanent termination of parental rights I think that may be a different issue. But at this time I will deny your writ.

(emphasis added). The signed order states that "Defendant's Plea Bar and Motion to Dismiss IndictmentDouble Jeopardy (Collateral Estoppel)" is denied. A docket sheet entry states "WRIT: DOUBLE JEOPARDY DENIED."
In Cantu's notice of appeal, she indicated she was appealing "the order of the trial court issuing the writ of habeas corpus, but denying relief thereon."

Arguments on Appeal
Before addressing Cantu's constitutional claims, we discuss the State's contention that we lack jurisdiction over this appeal.
1. Appellate Jurisdiction
The State correctly observes that we have jurisdiction over the denial of habeas corpus relief but lack jurisdiction over interlocutory appeals from special pleas. See Ex parte Apolinar, 820 S.W.2d 792, 794 (Tex. Crim.App.1991); Ex parte Walker, 813 S.W.2d 570, 571 (Tex.App.Corpus Christi 1991, pet. ref'd). Based on these holdings, the State argues that the trial court cannot interpret a special plea as a writ of habeas corpus, as was done in this case. Thus, Cantu's motion is a special plea over which we have no jurisdiction.
In our opinion in Apolinar v. State, 790 S.W.2d 108, 108 (Tex.App.San Antonio *704 1990), vacated and remanded, 820 S.W.2d 792, 794 (Tex.Crim.App.1991), the defendant appealed the trial court's pretrial ruling on his special plea raising double jeopardy.[3] For the first time on appeal, we interpreted the plea as an application for writ of habeas corpus, which conferred jurisdiction to discuss the merits of the defendant's claim. Id. at 109-10. In vacating our opinion, the Court of Criminal Appeals observed that we lacked constitutional or statutory authority to hear appeals from special pleas. Ex parte Apolinar, 820 S.W.2d at 794. In other words, an appellate court could not interpret a pleading as an application for habeas corpus rather than a special plea. See id. This restriction is not binding on the trial court. See Apolinar v. State, 790 S.W.2d at 110 ("Clearly, had the trial judge under these identical circumstances granted this identical motion, the State would have been permitted to appeal immediately.").
The district courts have exclusive jurisdiction over all causes of action not explicitly reserved to other courts. Tex. Const. art. V, § 8; TEX.GOV'T CODE ANN. § 24.007 (Vernon 1988). The courts' jurisdiction includes criminal actions. TEX.CODE CRIM. PROC.ANN. art. 4.01 (Vernon Supp.1995) (district courts generally); TEX.GOV'T CODE ANN. §§ 24.139, 24.274 (Vernon 1988) (186th district court). More particularly, the district courts have jurisdiction over writs of habeas corpus, TEX.CODE CRIM.PROC.ANN. art. 11.05 (Vernon 1977); and, when they sit as triers of fact, special pleas. Id. art. 27.07 (Vernon 1989).
Additionally, the district courts are not limited by the denomination of pleadings but may look to the essence of those pleadings. Cf. White v. Reiter, 640 S.W.2d 586, 593 (Tex.Crim.App.1982) (describing that court's original jurisdiction); TEX.R.CIV.P. 71 (governing misnomer of civil pleadings). In the case of the writ of habeas corpus, the courts are encouraged to elevate substance over form. See TEX.CODE CRIM.PROC.ANN. arts. 11.03, 11.04 (Vernon 1977). Given this encouragement and corresponding jurisdiction, we conclude that Ex parte Apolinar does not limit a trial court's ability to interpret a pleading as an application for writ of habeas corpus rather than a special plea.
Here, the pleading is styled as a special plea, but the trial court accepted Cantu's oral motion to amend the title and proceeded, without objection, as if the pleading were a writ. The State now argues that the pleading did not meet the requisites of TEX.CODE CRIM.PROC.ANN. art. 11.14 (Vernon 1977), and therefore cannot be interpreted as a petition for habeas corpus relief. Unlike its jurisdictional complaint, the State was required to raise this error before the trial court. See Ex parte Johnson, 811 S.W.2d 93, 94 (Tex. Crim.App.1991) (defects in form); Lopez v. State, 756 S.W.2d 49, 50-51 (Tex.App. Houston [1st Dist.] 1988, pet. ref'd) (jurisdiction). Because it did not, the State waived its argument.
Finally, the State contends we lack jurisdiction because no writ of habeas corpus was ever filed or issued. Generally, there is no appeal from the refusal to issue or grant a writ of habeas corpus. Ex parte Hargett, 819 S.W.2d 866, 868 (Tex.Crim.App.1991); Ex parte Carter, 849 S.W.2d 410, 412 (Tex. App.San Antonio 1993, pet. ref'd) (defendant appealed the court's refusal to issue a writ rather than denial of relief). However, when a hearing is held on the merits of an applicant's claim and the court subsequently rules on the merits of that claim, the losing party may appeal whether a writ issues or not. Ex parte Hargett, 819 S.W.2d at 867-68; Ex parte Martell, 901 S.W.2d 754, 755 (Tex.App.San Antonio 1995, no pet.) (per curiam).
Arguably, this analysis is complicated when a defendant files a combined application for writ of habeas corpus and special plea in bar. In Ex parte Walker, 813 S.W.2d at 571 (decided four months before Ex parte Hargett), the defendant filed a combined pleading; and, after a hearing, the trial court ruled on both motions. No writ of habeas corpus issued, so the appellate court concluded *705 that the only matter discussed at the hearing was the special plea, which did not confer appellate jurisdiction. Id. Contra Ex parte Rogers, 804 S.W.2d 945, 948 n. 3 (Tex. App.Dallas 1990, no pet.) (interpreting a joint motion as conferring appellate jurisdiction).
We do not find Ex parte Walker controlling because Cantu filed a single issue pleading that resulted in a single issue ruling. The record is silent as to whether the trial court issued the writ. However, Cantu was clearly before the court. The court heard evidence and ruled on the merits of Cantu's claim. Thus, under Ex parte Hargett, she is entitled to appeal the ruling against her.
2. Double Jeopardy
In her first point of error, Cantu maintains that the federal double jeopardy clause bars prosecution for injury to a child because she was previously punished for the same conduct in the civil suit. The State contends that double jeopardy cannot apply because Cantu's claim is premature and any action involving her parental rights is not punishment.
a. Prematurity
The double jeopardy clause applies only if there has been some type of event, such as an acquittal, which terminates the original jeopardy. Ex parte Queen, 877 S.W.2d 752, 754 (Tex.Crim.App.1994), cert. denied, ___ U.S. ___, 115 S.Ct. 910, 130 L.Ed.2d 792 (1995); Lewis v. State, 889 S.W.2d 403, 409 (Tex.App.Austin 1994, pet. ref'd). Absent a final judgment, a defendant remains under the initial jeopardy, and a retrial for the same offense is not double jeopardy. Ex parte Queen, 877 S.W.2d at 754 (citing Ex parte McAfee, 761 S.W.2d 771, 773 (Tex.Crim.App.1988)).
Here, Cantu's complaint centers on temporary orders issued in a suit affecting the parent-child relationship. This order, by its very nature, is not a final judgment. See TEX.FAM.CODE ANN. § 17.04 (Vernon 1986) (authorizing the court to issue temporary orders in emergency suits brought by the government). Thus, Cantu faces no double jeopardy in the pending criminal action.
b. Punishment
The double jeopardy clause protects against three distinct abuses: (1) a second prosecution for the same offense after acquittal; (2) a second prosecution for the same offense after conviction; and (3) multiple punishments for the same offense. North Carolina v. Pearce, 395 U.S. 711, 717, 89 S.Ct. 2072, 2076, 23 L.Ed.2d 656 (1969). This appeal involves the third protection.
In certain "rare cases," a civil proceeding may be considered punitive for double jeopardy purposes if the penalty "cannot fairly be said solely to serve a remedial purpose, but rather can only be explained as also serving either retributive or deterrent purposes." United States v. Halper, 490 U.S. 435, 449, 109 S.Ct. 1892, 1902, 104 L.Ed.2d 487 (1989) (involving civil forfeiture); see also Department of Revenue of Montana v. Kurth Ranch, ___ U.S. ___, ___, 114 S.Ct. 1937, 1948, 128 L.Ed.2d 767 (1994) (involving a tax statute). To determine if a given civil sanction constitutes punishment, we assess the penalty imposed and the purposes served by it. Halper, 490 U.S. at 446, 109 S.Ct. at 1901.
In Malone v. State, 864 S.W.2d 156, 158 (Tex.App.Fort Worth 1993, no pet.), the defendant argued that the State could not prosecute him for the sexual abuse of his child because the State had used the same allegations in an earlier suit to terminate his parental rights. While the defendant's parental rights had not been terminated, they had been restricted as a consequence of the appointment of the State as the child's managing conservator. Id. at 159. The appellate court concluded that the trial court did not err in denying the defendant's plea of prior jeopardy because:
Even if [the defendant's] parental rights had been terminated, we do not believe this would have constituted a penalty. While a termination suit can result in a parent's loss of his or her legal relationship with the child, the sole goal is the best interest of the child. Applying the rationale in Halper, the termination of parental rights is remedial in nature and relates to the State's interest in protecting abused and neglected children, not punishment of *706 the parent. We hold that the termination of parental rights is a civil proceeding with a remedial result, not triggering jeopardy for a subsequent criminal proceeding.

Id. (emphasis added).
In a custody suit, the trial court bases its decision on the best interest of the children, which necessarily entails factors beyond that of the State's criminal allegations. See MacDonald v. MacDonald, 821 S.W.2d 458, 460-61 (Tex.App.Houston [14th Dist.] 1992, no writ). We agree with the Fort Worth court of appeals. When the State seeks custody of children, it pursues a purely remedial function: the protection of minors. It does not aim to punish the parents or to impose retribution. Thus, lost custody cannot be considered punitive for double jeopardy purposes. Because we find that Cantu does not face multiple "punishments," we conclude the trial court did not err in denying her federal double jeopardy claim.[4]
We overrule Cantu's first point of error.
c. Texas Constitution
In her second point of error, Cantu argues that the Texas Constitution provides greater protection than does the federal constitution. There is no need to address Cantu's contention because we find that she was not "punished" under either constitution. See Ex parte Broxton, 888 S.W.2d 23, 28 (Tex.Crim. App.1994), cert. denied, ___ U.S. ___, 115 S.Ct. 2584, 132 L.Ed.2d 833 (1995).[5]
We overrule Cantu's first point of error.

Conclusion
We affirm the trial court's habeas corpus judgment.
NOTES
[1]  We restyled the case from the original "Rachel Cantu v. State of Texas." See Ex parte Carter, 849 S.W.2d 410, 411-12 nn. 2-3 (Tex.App.San Antonio 1993, pet. ref'd).
[2]  The statement of facts from this hearing is entitled "WRIT OF HABEAS CORPUS."
[3]  Normally, a special plea is presented to the fact finder during the trial on the merits. TEX.CODE CRIM.PROC.ANN. art. 27.05 (Vernon 1989).
[4]  Cantu suggests the State should press its civil and criminal claims in one trial. See Halper, 490 U.S. at 450, 109 S.Ct. at 1903 (permitting the State to join civil and criminal penalties in the same proceeding when the legislature authorizes cumulative punishments). Even if loss of child custody could be termed punishment, we note that our legislature has not authorized the joinder of such a civil action with a criminal action. We perceive serious procedural and substantive problems with Cantu's proposal.
[5]  Other courts that have addressed the protection issue have concluded that the state and federal double jeopardy clauses provide identical protections. See, e.g., Guerrero v. State, 893 S.W.2d 260, 261 (Tex.App.Waco 1995, no pet.) (collecting cases); Ex parte Davis, 893 S.W.2d 252, 255-56 (Tex.App.Austin 1995, no pet.); Parrish v. State, 889 S.W.2d 658, 660-62 (Tex. App.Houston [14th Dist.] 1994, pet. ref'd).
