Upon motion of either party, the court by its order and process may compel the production of any written document or any other thing which may be necessary or proper to be produced or exhibited as evidence on trial and may punish a disobedience of its orders or process as in case of witnesses refusing to testify.