I am trying to access and change the particular attribute from XML tag
XML:
<
You can access the attributes directly in the [xml] object like this:
# C:\temp> $xml = [xml](Get-Content C:\FE6Work.xml)
# C:\temp> $xml.office.staff
branch Type employee
------ ---- --------
Hanover sales {Tobias Weltner, Cofi Heidecke}
London Technology {XXXX, Cofi}
# C:\temp> $xml.office.staff | foreach{$_.branch = "New York"}
# C:\temp> $xml.office.staff
branch Type employee
------ ---- --------
New York sales {Tobias Weltner, Cofi Heidecke}
New York Technology {XXXX, Cofi}