If the person alleged to be of unsound mind is a resident of the county and is at the time of the application confined in a hospital or asylum within or without the state, inquisition may be had and taken without notice to him or her , but, on the filing of the application, the court must appoint a guardian ad litem to represent and defend for him or her. It shall be the duty of such guardian by answer to put in issue the facts stated in the application and to employ counsel at the expense of such person of unsound mind to appear and defend him or her.