how i can add new tag in xml file by use linq to xml and i want the new tag the first tag
<?xml version="1.0" encoding="utf-8"?>
<settings>
<Device>
<username>fooo</username>
<AgentName>fooo</AgentName>
<password>fooo</password>
</Device>
<Device>
<username>fooo1</username>
<AgentName>fooo1</AgentName>
<password>fooo1</password>
</Device>
</settings>
now i want to add a new tag to make file like that
<settings>
<IncommingConfig>
<ip>10.100.101.18</ip>
<port>5060</port>
</IncommingConfig>
<Device>
<username>fooo</username>
<AgentName>fooo</AgentName>
<password>fooo</password>
</Device>
<Device>
<username>fooo1</username>
<AgentName>fooo1</AgentName>
<password>fooo1</password>
</Device>
</settings>
That’s easy using
XContainer.AddFirst, which adds the given value as the first child: