I am trying to write an XML parser to parse all courses from that a university offers given a calendar year and semester. In particular, I am trying to get the department acronym (i.e. FIN for Finance, etc), the Course Number (i.e. Math 415, 415 would be the number), the Course Name, and the number of credit hours the course is worth.The file I am trying to parse can be found HEREHere is my parser class:\[code\]public class CourseListParser { private const string listPath = "http://courses.illinois.edu/cisapp/explorer/schedule/"; private string xmlPath; private Departments deps; public Departments DepartmentsAndCourses { get { return deps; } } public CourseListParser() { xmlPath = null; deps = new Departments(); } public CourseListParser(string calendarYear, string semester) { xmlPath = listPath + calendarYear + "/" + semester + ".xml"; deps = new Departments(); } public void Parse() { XDocument doc = XDocument.Load(xmlPath); // Load the file foreach (XElement elem in doc.Root.Element("subjects").Elements()) { string acronym = elem.Attribute("id").Value; string depPath = xmlPath.Replace(".xml", "/" + acronym + ".xml"); deps.Add(acronym, new CourseList()); ParseCourseList(depPath, acronym); } } private void ParseCourseList(string depPath, string ID) { try { XDocument doc = XDocument.Load(depPath); foreach (XElement elem in doc.Root.Element("courses").Elements()) { string crseNum = elem.Attribute("id").Value; string crsePath = depPath.Replace(".xml", "/" + elem.Attribute("id").Value + ".xml"); deps[ID].Add(crseNum, new CourseInformation()); deps[ID][crseNum].Add("XmlPath", crsePath); deps[ID][crseNum].Add("CourseName", elem.Value); /* EXCLUDED PORTION (Refered to below) */ XDocument hoursDoc = XDocument.Load(crsePath); deps[ID][crseNum].Add("CreditHours", hoursDoc.Root.Element("creditHours").Value); } } catch (WebException) { } // No courses exist in that department }}\[/code\]The issue I am having is that when I exclude the portion marked above as EXCLUDED PORTION, the parser takes about 25-30 seconds, and when I include that section, the parser goes for several minutes before I eventually cancel the unit test. With all that being said, why does that portion of code result in basically an infinite long process and what changes need to be made in that aforementioned portion to fix the issue described? Finally, I am kind of new to LINQ/XML and any advice on how to optimize this code for speed would be greatly appreciated. EDIT/UPDATEAs mentioned in the comments below, given that I need only one line of information from the "EXCLUDED PORTION" of the code above, I have changed that part to:\[code\] using (XmlReader reader = XmlReader.Create(crsePath)) { reader.ReadToFollowing("creditHours"); deps[ID][crseNum].Add("CreditHours", reader.ReadInnerXml()); }\[/code\]And am running it now, I am aware that this process can take several minutes, luckily for me, this will only be run once a semester. Thanks to all the comments/answers.Thanks,David