Used ?? to remove a lot of null xAttribute checking