Thanks to the help of @Mathias R. Jessen i was able to get this working but what I am trying to do is add a variable on the top of the script to set the model name but i am not having any luck. Any ideas?
$modelselect = "HP EliteBook x360 830 G7"
$file = "C:\Temp\test1.xml"
$xmlfile = [XML](Get-Content $file)
$item = Select-Xml $xmlFile -XPath '//Model[./ModelName = "$modelselect"]'
foreach($node in $item.Node)
{
$node.ParentNode.RemoveChild($node)
}
$xmlFile.Save($file)