replace xml element
- by snorlaks
Hello,
Im doing something like that:
var results = from d in myDocument.Elements().Descendants("myName") select d;
foreach (var result in results){
if (sth...){
result.replace(myXElement);
}
}
The problem is that when I replace an element I cant iterate to the next element cause there is null reference. (var result in results).
Is there any other way to replace that element with another one and still be able to iterate through that document ?
thanks for help