I have an xml file likes below.
<?xml version="1.0" encoding="utf-8" ?>
<Book>
<Title>Title</Title>
<Content>Content</Content>
</Book>
I want to write a new node after ‘Content’, I know how to use XMLDocument to do that, is there a way to use XMLTextWriter to do that?
You will have to write the whole Xml document, i.e. all elements and attributes and attribute values by using the
XmlTextWriter. After you’ve written the<Content>element, you can write your additional element.Something like this: