Find or create an element by xpath using LINQ-to-XML

Does anyone have a neat way of finding or creating an XObject using an xpath expression.

The problem I am having is that I need to set a value on an element (which I have the xpath for), which may or not be in existence. If it's not in existence I would like it to be created.

Any hints or links would be very much appreciated.

Thanks all.

7
задан Dimitre Novatchev 5 January 2011 в 14:38
поделиться