title: How do I determine if an XmlNode has a specific attribute?
body: <p>I would like to place an if condition within the sub that will tell it to run when the xml node STORE with attribute TEST="test.doc" does not exist. Any suggestions would be great. I'm new to vb.  </p>
  
  <pre><code>Sub InsertNode(ByVal doc As XmlDocument)   
      Dim City As XmlNode = doc.DocumentElement
  
      Dim Location As XmlElement = doc.CreateElement("store")
      Location.SetAttribute("test", "test.doc")
  
      Dim books As XmlElement = doc.CreateElement("books")
      books.InnerXml = "New Words"
      Location.AppendChild(books)
  
      City.AppendChild(store)
  End Sub 'InsertNode
  </code></pre>
  
  <p><hr />
  Sample of the XML file</p>
  
  <pre><code>&lt;city&gt;
      &lt;store test="test.doc"&gt;
          &lt;books&gt;
          "New Words" 
          &lt;/books&gt;
      &lt;/store&gt;
  &lt;/city&gt;
  </code></pre>