Writs of habeas corpus ad testificandum may be granted by any circuit court in the same manner and under the same conditions and provisions as are prescribed by this chapter as to granting the writ of habeas corpus ad subjiciendum so far as the same are applicable.
Va. Code § 8.01-666