February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Remove method of XElement or XAttribute is used to remove the current node.
In the following example, the first name element is removed from the document:
[XDocument]$xDocument = @"
<?xml version="1.0"?>
<list type='numbers'>
<name>1</name>
<name>2</name>
<name>3</name>
</list>
"@$xDocument.Element('list').FirstNode.Remove()
Read now
Unlock full access