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.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. A writ of habeas corpus is an order from a court to an official to produce an inmate. Writ of Habeas Corpus for Return of Child. Habeas Corpus: A remedy to have a child immediately returned from someone who does not have a right to possess the child. It also requires that the state officer having custody of the applicant be named as respondent. In Texas, grounds for a writ of habeas corpus in child custody cases can include concerns about the child's safety, wellbeing, or living conditions. If they are all from the same proceedings, must fill out a separate form for each cause number.