Alternatively ... if you know that the name of the elements will never change and they always exist,
XDocument xD = XDocument.Load(XmlFullFileName); XElement xE_ParameterSets = xD.Root.Element("Report").Element("ParameterSets"); int index = ((IEnumerable<XElement>)xE_ParameterSets.Elements()).Count();
ablaze
source share