public static IEnumerable <string> NodeNames(this DomNodeCollection source) { if (source == null) { return(Enumerable.Empty <string>()); } return(source.Select(n => n == null ? "<null>" : n.NodeName)); }