title: Maximum number of attributes a node has in a XML document
body: <p>We are interested in finding maximum number of attributes a node has in a XML document. My code is below using C#:</p>
  
  <pre><code>        XmlDocument xmlDoc = new XmlDocument();
          xmlDoc.Load(@"C:\ABC.xml");
          XmlNode root = xmlDoc.DocumentElement;
  
          int nodeAttrCount = 0;
          foreach (XmlNode node in root)                            
              if (nodeAttrCount &lt; node.Attributes.Count)
                  nodeAttrCount = node.Attributes.Count;
  </code></pre>
  
  <p>We are interested is: do we have any thing better than this. Like any method or property which give us the same result or anyother option.</p>