title: Counting empty Elements in foreach from xml
body: <p>So i have a XML File which i read and iterate through with a foreach loop.</p>
  
  <p>so far so good. 
  Now i need to check if an Object is empty so i can prompt the User to Enter the Info.</p>
  
  <p>right now i have to check every Object by Name if it is Empty.</p>
  
  <pre><code>foreach($var in $xml){
      if(!$var.Object1){$count++}
      if(!$var.Object2){$count++}
  
      do{
       more Stuff depending on the count Value
      }
      while($i -ne $count
  }
  </code></pre>
  
  <p>as you can see i this will be a long list fast, depending how big your xml file is.
  I don't want to write out every Object Name. 
  I am wondering if i can just get the amount of objects and then loob through it if one of it is empty
  somehwat like this</p>
  
  <pre><code>foreach($var in $xml){
    $c = $var.count
    for(i=1; $i -le $c; $i++){
      if(!$var.object$i){$count++}
    } 
  
  do{
     more Stuff depending on the count Value
  }
  while($i -ne $count
  }
  </code></pre>
  
  <p>i could save a lot of lines. But i can't figure out how to do this or if this is even Possible...
  at the moment i refuse to belive that you HAVE to ask every single Object if it is Empty.</p>
  
  <p>I dumped down this script to a few lines. The actual Script is a bit larger. (the do part has around 25 lines) But i wanted to keep it as small as possible. </p>
  
  <p>If it is neccessary i can post my whole Script.</p>
  
  <p>thanks in advance and Regards</p>