title: How to select elements with non-empty children
body: <p>I need to output all the information from a nodes children that are not empty.</p>
  
  <p>What I have currently(not working): <code>Country/State/cities/city[string-length(*) != 0]/*</code> </p>
  
  <p>Each city element has 4 child nodes: name, population, size, foundingDate.</p>
  
  <p>I need to print all info for all the cities of all the states, but only the values that aren't null.</p>
  
  <p>Odd sounding, I know.</p>
  
  <p>What would be the proper way to do this?</p>
  
  <p><strong>EDIT</strong>: This is how the XML is formed. (I had written the path line above wrong, but fixed it.) Of course there are multiple State and City elements.</p>
  
  <pre><code>&lt;Country&gt;
    &lt;State&gt;
      &lt;Name&gt;stateName&lt;/name&gt;
      &lt;Cities&gt;
        &lt;City&gt;
          &lt;Name&gt;cityName&lt;/Name&gt;
          &lt;Population&gt;popNum&lt;/Population&gt;
          &lt;Size&gt;citySize&lt;/Size&gt;
          &lt;foundingDate&gt;foundingYear&lt;/foundingDate&gt;
        &lt;/City&gt;
      &lt;/Cities&gt;
    &lt;/State&gt;
  &lt;/Country&gt;
  </code></pre>
  
  <p>The objective is to output all the City info for the Country that does not have empty values. (The XML value isn't completed, but still needs to be searched.)</p>