How can I set an attribute of node in XML file in c#

Fuad

New Member
I have a xml file like this\[code\]<?xml version="1.0" encoding="utf-8"?><ArrayOfOffice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Offices><Office><OfficeId>5</OfficeId><OfficeName>NewOne1</OfficeName><City>Mehsana1</City><Country>India1</Country></Office><Office><OfficeId>8</OfficeId><OfficeName>NewOne</OfficeName><City>Mehsna1</City><Country>Country</Country></Office><Office><OfficeId>9</OfficeId><OfficeName>Nataraj</OfficeName><City>Mehsana</City><Country>India</Country></Office><Office><OfficeId>10</OfficeId><OfficeName>Nere1</OfficeName><City>Nere1</City><Country>USA1</Country></Office><Office><OfficeId>11</OfficeId><OfficeName>Nataraj</OfficeName><City>Mehsana</City><Country>India</Country></Office><Office><OfficeId>15</OfficeId><OfficeName>Nere1</OfficeName><City>Nere1</City><Country>USA1</Country></Office></Offices></ArrayOfOffice>\[/code\]Now I want to add an attribute in \[code\]<Offices>\[/code\] Tag like \[code\]<Offices Multi="Y">..........</Offices>\[/code\]How can I set this \[code\]Multi="Y"\[/code\] in \[code\]Offices\[/code\] Node using C#? Do I have to edit the xml File and save back to that xml file?Thanks.
 
Back
Top