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.
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.