public XElement CreateRootElement() { return(new XElement("Project", new XAttribute("Sdk", Sdk), new XElement("PropertyGroup", new XElement(TargetFrameworks.Count > 1 ? "TargetFrameworks" : "TargetFramework", TargetFrameworks.Aggregate((a, b) => a + ';' + b)), OutputType != null ? new XElement("OutputType", OutputType) : null, LangVersion != null ? new XElement("LangVersion", LangVersion) : null, new XElement("AssemblyName", ProjectName)), new XElement("ItemGroup", UnifiedPackageReferences.Select(p => new XElement("PackageReference", new XAttribute("Include", p.Name), new XAttribute("Version", p.Version)))))); }