A deep dive into the concept of habeas corpus in child custody disputes and its role in enforcing court orders.. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child.If the inmate has exhausted their appeals, the lawyer could file a petition for habeas corpus as long as valid grounds appear to exist. This guide includes forms and instructions for a letter and affidavit to request that the court register an outofstate custody order in Texas. In child custody cases, parents or guardians can use the writ of habeas corpus to contest the legality of custody arrangements. Court Order for Conservatorship of the Child(ren). Choose one: Check (1) if you are claiming superior rights under a court order. Habeas Corpus: A remedy to have a child immediately returned from someone who does not have a right to possess the child. Available as both a PDF and Word document. Petition for a Writ of Habeas Corpus Under 28 U.S.C. § 2241.