Dim xmlDoc, node, nodeList, fileName, backupFileName, numberOfPOQNodes Set xmlDoc = CreateObject("Microsoft.XMLDOM") If Wscript.Arguments.Count = 0 Then WScript.echo("Error! No XML file specified.") Wscript.quit End If fileName = WScript.Arguments(0) backupFileName = Left(fileName, InStrRev(fileName, ".") - 1) & "_backup.xml" If Not xmlDoc.load(fileName) Then WScript.echo("Failure loading XML file " & fileName & ".") Wscript.quit End If xmlDoc.save(backupFileName) Set nodeList = xmlDoc.documentElement.selectNodes("POQ") numberOfPOQNodes = nodeList.Length For Each node in nodeList xmlDoc.documentElement.removeChild(node) Next xmlDoc.save(fileName) Set xmlDoc = Nothing WScript.echo(numberOfPOQNodes & " POQ nodes removed. Script completed.")