96. Whenever any prisoner is required to appear before any court, to give evidence, or for any other purpose, it shall be lawful for such court in its discretion, if it considers the presence of such prisoner necessary for the ends ofjustice, by an order in writing to direct the Superintendent of the prison, where such prisoner shall be imprisoned to produce such prisoner before such court, and such Superintendent shall in the absence of good and sufficient cause to the contrary, cause such prisoner to be produced in compliance with such order. *Order for productionof prisoners beforeany court,*