If the witness be a prisoner, confined in a jail or prison within this state, an order for his examination in the prison upon deposition, or for his temporary removal and production before a court or officer for the purpose of being orally examined, may be made by any justice of the supreme court or judge or magistrate of the district court.
Idaho Code § 9-711