Va. Code Ann. § 53.1-206
Prisoners may be surrendered as witnesses if a judge of any court of record of the United States or of the District of Columbia, or of any state certifies under the seal of such court that:
4. The prisoner will be safely returned to the custody of the Director at such state correctional facility, as the Director may direct.
Upon presentation of such certificate to the Director, if he is of the opinion that the ends of justice will be promoted thereby, the Director may, with the approval of the Governor, surrender the prisoner into the custody of the officer named in the certificate.
Code 1950, § 53-301; 1970, c. 648; 1982, c. 636.