Clay County prosecutor formally resigns