title: Traverse XML document using asp
body: <p>I'm trying to find if a certain element is present in a XML file and if it is, remove it. However I keep getting this error: </p>
  
  <pre><code>Description: Type mismatch: 'NodeList'
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>&lt;%@ Language=VbScript%&gt;
  &lt;%
  
  Dim address
  
  Set xmlDoc = CreateObject("Microsoft.XMLDOM")
  xmlDoc.async = False
  xmlDoc.load (Server.MapPath("XML/sensor.xml"))
  
  Set Root = XMLDoc.documentElement 
  
  Set NodeList = Root.getElementsByTagName("sensor")
  
  For Each i In NodeList
  
      if ((NodeList(i).getElementsByTagName("Address")(0).childNodes(0).nodeValue)=request.form("remove_address")) then
      NodeList.parentNode.removeChild NodeList 
      End if
  Next
  
  
  
  NodeList.parentNode.removeChild NodeList 
  xmlDoc.Save "\www./XML/sensores.xml"
  
  Response.Redirect("remove_sensor_modbus.html")
  
  %&gt;
  </code></pre>
  
  <p>And the XML file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;sensors&gt;
  &lt;sensor&gt;
      &lt;Address&gt;40000&lt;/Address&gt;
  &lt;/sensor&gt;
  &lt;sensor&gt;
      &lt;Address&gt;46999&lt;/Address&gt;
  &lt;/sensor&gt;
  &lt;/sensors&gt;
  </code></pre>
  
  <p>The form is a dropdown menu populated with this same XML file. 
  Does anyone knows what could be causing this error?</p>