Removing nodes

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()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.50.183