static List <Inspection> LoadInspections(string inspectionDataFile) { using (Stream stream = GetResourceStream(inspectionDataFile)) using (XmlReader xmlRdr = new XmlTextReader(stream)) return ((from inspectionElem in XDocument.Load(xmlRdr).Element("inspections").Elements("inspection") select Inspection.CreateInspection( (int)inspectionElem.Attribute("inspectionID"), (int)inspectionElem.Attribute("projectID"), (DateTime)inspectionElem.Attribute("date"), (string)inspectionElem.Attribute("inspector"), (string)inspectionElem.Attribute("notes") )).ToList()); }