using System.Xml.Linq;
// ...
public void GetXML() {
var doc = XDocument.Parse(
$@"<Configuration ID="190e515a-6490-4b3f-af00-c43ebedcf951">
<Add OfficeClientEdition="{(mimari64CheckBox.Checked ? "64" : "32")}" Channel="Broad">
<Product ID="O365ProPlusRetail">
<Language ID="tr-tr" />
</Product>
</Add>
<Property Name="SharedComputerLicensing" Value="0" />
<Property Name="PinIconsToTaskbar" Value="TRUE" />
<Property Name="SCLCacheOverride" Value="0" />
<Property Name="AUTOACTIVATE" Value="0" />
<Property Name="FORCEAPPSHUTDOWN" Value="FALSE" />
<Property Name="DeviceBasedLicensing" Value="0" />
<Updates Enabled="TRUE" />
<RemoveMSI />
</Configuration>"
);
if(accessCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Access"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(excelCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Excel"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(grooveCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Groove"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(lyncCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Lync"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(onedriveCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","OneDrive"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(onenoteCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","OneNote"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(OutlookCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Outlook"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(powerpointCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","PowerPoint"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(publisherCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Publisher"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(teamsCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Teams"));
doc.Root.Element("Add").Element("Product").Add(element);
}
if(wordCheckBox.Checked) {
var element = new XElement("ExcludeApp");
element.Add(new XAttribute("ID","Word"));
doc.Root.Element("Add").Element("Product").Add(element);
}
}