public IFCProjectInfo GetprojectInfo(string _XMLPath) { XDocument xDoc = XDocument.Load(_XMLPath); var ProjectInfo = new IFCProjectInfo { Files = new List <CopyDetails>(), Folders = new List <CopyDetails>(), StartFiles = new List <StartFile>() }; var Folders = xDoc.Element("Project").Element("Folders").Elements("Folder"); var Files = xDoc.Element("Project").Element("Files").Elements("File"); var StartFiles = xDoc.Element("Project").Element("StartFiles").Elements("StartFile"); foreach (var Folder in Folders) { ProjectInfo.Folders.Add(new CopyDetails { From = Folder.Attribute("From").Value, To = Folder.Attribute("To").Value, Export = Folder.Attribute("Export").Value, Discipline = Folder.Attribute("Discipline").Value }); } foreach (var File in Files) { ProjectInfo.Files.Add(new CopyDetails { From = File.Attribute("From").Value, To = File.Attribute("To").Value, Export = File.Attribute("Export").Value }); } foreach (var StartFile in StartFiles) { ProjectInfo.StartFiles.Add(new StartFile { Path = StartFile.Attribute("Path").Value, Discipline = StartFile.Attribute("Discipline").Value }); } return(ProjectInfo); }