Let´s say I have the following xml,
<Where><BeginsWith>...</BeginsWith></Where>
and now I want to "insert" an <And>
clause that surrounds the BeginsWith clause so it looks like this afterward,
<Where><And><BeginsWith>...</BeginsWith></And></Where>
How do I accomplish that with LinqToXml?
The Add method where I essentially do
where.Add(new XElement("And"))
will only add the the "And" after BeginsWith, like this,
<Where><BeginsWith>...</BeginsWith><And /></Where>