Я хочу создать XML-файл этой структуры:Создание XML с XDocument
<Devices>
<Device Number="58" Name="Default Device" >
<Functions>
<Function Number="1" Name="Default func" />
<Function Number="2" Name="Default func2" />
<Function Number="..." Name="...." />
</Functions>
</Device>
</Devices>
Вот мой код:
document.Element("Devices").Add(
new XElement("Device",
new XAttribute("Number", ID),
new XAttribute("Name", Name),
new XElement("Functions")));
Каждый объект "устройство" есть список <> из "функций", как может Я добавляю «функции» в xml ???
спасибо, очень просто –