Move the definition of
sections
outside the loop, and use an index to access it. Or better, use a
List<string>
so you don't have to work with a fixed number of elements:
System.Xml.XmlNodeList Chapters = doc.SelectNodes("ICD10CM.tabular/chapter");
System.Xml.XmlNodeList Sections = doc.SelectNodes("ICD10CM.tabular/chapter/sectionIndex");
List<string> sections = new List<string>();
foreach (System.Xml.XmlNode CC in Sections)
{
sections.Add(CC.SelectSingleNode("sectionRef").InnerText);
}