The Remove method of an 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()