A 38-year-old man was taken to Dumfries and Galloway Royal Infirmary for treatment to what were described as serious injuries.