A Texas Petition for Writ of Habeas Corpus is a legal document used in Texas to challenge the legality of a prisoner’s detention or imprisonment. Specifically, it is a petition that requests a court to order a person or government official who has custody of a prisoner to produce the prisoner, so the court can determine the legality of the detention. This petition may also be used to challenge the conditions of the confinement or the validity of a conviction. There are two types of Texas Petition for Writ of Habeas Corpus: the State Petition and the Federal Petition. The State Petition is used to challenge the legality of a confinement in a state prison, while the Federal Petition is used to challenge the legality of a confinement in a federal prison. Both types of petition require the petitioner to provide evidence that the confinement is unlawful. If the court finds in favor of the petitioner, then the court may order the release of the prisoner or provide other relief.