The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. Instead habeas corpus is a vehicle to make a record of new evidence that demonstrates either innocence or a constitutional violation.The purpose of a Writ of Habeas Corpus is for the court to determine whether it has lawfully convicted and sentenced a person. A writ of habeas corpus is a legal tool used to enforce a superior right of possession to a child. An application for a Writ of Habeas Corpus is filed when a person seeks relief from unlawful detention or imprisonment. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. A writ of habeas corpus is a legal order that commands an individual or entity to produce a person who is allegedly being detained unlawfully. Fill out the Petition for Writ of Habeas Corpus to Return Child. Essentially, a writ of habeas corpus is a legal means for any person who is restrained in his liberty to challenge an unlawful restraint. Inmates in Texas are allowed to appeal their sentences or convictions to a higher court.