title: Change the attribute value of an XML Node
body: <p>I am trying to change an existing attribute value of an XML Node that has child nodes.  I am getting an exception when trying to do this.  </p>
  
  <pre><code>string specificOwnerPath = "Owners/Owner[@id='" + startingOwnerName + startingOwnerZipCode + "']";
  XmlNode ownerID = doc.SelectSingleNode(specificOwnerPath);
  ownerID.Attributes["id"].Value = ownerNameTextBox.Text + ownerZipCodeTextBox.Text;
  </code></pre>
  
  <p>The exception I am getting says 'Object reference not set to the instance of an object and is occurring at the final line of code shown above.  Does anyone have any suggestions on what I am doing wrong?  </p>