title: remove attribute if it exists from xmldocument
body: <p>How to remove the attribute from XmlDocument if attribute exists in the document? Please help. I am using RemoveAttribute but how can I check if it exists.</p>
  
  <p>root.RemoveAttribute(fieldName);</p>
  
  <p>Thanks..</p>
  
  <pre><code> &lt;?xml version="1.0" standalone="yes" ?&gt; 
   &lt;Record1&gt;
    &lt;Attribute1 Name="DataFieldName" Value="Pages" /&gt; 
   &lt;/Record1&gt; 
  </code></pre>
  
  <p>I am trying to remove attribute named "DataFieldName".</p>