so I already have a XML-File which got a lot of Elements, but without any value in them. Now I want do insert some Value in that already existing XML File. So I created an XmlWriter and an XmlReader. After, I started writing the XMLDocument and Copied everything from the Reader like this:
xmlWriter.WriteStartDocument();
xmlWriter.WriteNode(reader, true);
If I just leave it like that (with of course the xmlWriter.WriteEndDocument();
and xmlWriter.Close();
at the end), I will then have a new XML-File which is an exacty Copy of my default one.
My Question now is: Is it possible to add some Values and then safe this new XML-File? So basically an Copy of the default one + Values.
In Case you are wondering, what I mean by Values, I mean the "TestUser" like in the following:
<User>TestUser</User>
I´ve done some research on the Internet how to do this, but sadly I couldnt find anything.
Thanks for your help!
EDIT:
My XML looks something like this (of course larger, thats just a small example):
<users>
<user></user>
<user></user>
</users>
And I want this XML to be Copied with some added Values, For Example:
<users>
<user>TestUser1</user>
<user>TestUser2</user>
</users>