title: What exception type to throw if a list/collection is empty or null and cannot be iterated (not a parameter)?
body: <p>Suppose a simple example where a method retrieves a collection (such as a list containing some configuration strings) and tries to examine it in some way:</p>
  
  <pre><code>void Init()
  {
      XmlDocument config = new XmlDocument();
      config.Load(someXml);
      var list = config.SelectNodes("/root/strings/key"); // Normally, list should not be null or empty
  
      if (list == null || list.Count == 0)
          throw new SomeExceptionType(message);   // What kind of exception to throw?
  
      // Iterate list and process/examine its elements
      foreach (var e in list) ...
  }
  </code></pre>
  
  <p>In this specific instance, the method cannot continue normally if nothing was retrieved. I'm unsure what exception type to throw in such situations. My options are, as far as I know:</p>
  
  <ul>
  <li><p>throw nothing manually and let <code>NullReferenceException</code> be thrown
  automatically (which doesn't handle empty list situation),</p></li>
  <li><p>throw custom exception type (probably not a good idea, as I don't anticipate the caller will try to do anything about the exception,
  i.e. he won't be looking for a speecific exception type to handle),</p></li>
  <li>do something else?</li>
  </ul>