Note the use of Elements() instead of Descendants(). That will get you all the name attributes. It's unclear to me why you were grouping in your original sample code, but hopefully this will get you going.