How to change the XML file Root and XmlDeclaration using C#

HI Expert ;

I have the following XML File and I want to process somme modifications as Changing the The  Node name <NewDataSet> to <ActualKPITest> and XMLDeclartion  <?xml version="1.0" standalone="yes" ?>  to  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>

My file is :
  <?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <SSISPackageLayout>
  <Description>This represents the version number of auditing framework. This number is updated when auditing framework changes are applied.</Description>

How to do that with C#
Who is Participating?
Gururaj BadamConnect With a Mentor Commented:
wow!! that's good. How?
Gururaj BadamCommented:
You can import the xml into DataSet.ReadXml first, then modify the Table name NewDataSet to ActualKPITest and write back to whatever for you need using DataSet.WriteXml overloads
FatehbourghoudAuthor Commented:
The Child Node i <SSISPackageLayout> is my table name I don't want to change it , the probleme is the Dataset.WriteXML  overload create the default Node  <NewDataSet> . and I wnat to replace it

02- what about the changing  XMLDeclartion  <?xml version="1.0" standalone="yes" ?>  to  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  , any solution ?

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Gururaj BadamCommented:
FatehbourghoudAuthor Commented:
I fixed the bug
FatehbourghoudAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.