У меня есть 2 вопроса:
1. Я начал работать с Linq в XML, и мне интересно, можно ли изменить документ XML через Linq. Я имею в виду, есть ли что-то вроде
XDocument xmlDoc = XDocument.Load("sample.xml");
update item in xmlDoc.Descendants("item")
where (int)item .Attribute("id") == id
...
2. Я уже знаю, как создать и добавить новый XMLElement, просто используя
xmlDoc.Element("items").Add(new XElement(......);
но как я могу удалить одну запись?
Данные примера XML:
<items>
<item id="1" name="sample1" info="sample1 info" web="" />
<item id="2" name="sample2" info="sample2 info" web="" />
</itmes>