I am trying to access and change the particular attribute from XML tag
XML:
<
Try the following:
$nodes = $xml.SelectNodes("/office/staff"); foreach($node in $nodes) { $node.SetAttribute("branch", "New York"); }
This will iterate through all nodes returned by SelectNodes() and modify each one.