title: xslt xml html: how to distinguish the same elements with or without child?
body: <p>The problem is I want to distinguish same elements name with different situation. For example:</p>
  
  <pre><code>&lt;element&gt;Hello StackOverFlow&lt;/element&gt;
  &lt;element&gt;
    &lt;group&gt;
       &lt;ge&gt;hello g1&lt;/ge&gt;
       &lt;ge&gt;hello g2&lt;/ge&gt;
    &lt;/group&gt;
    &lt;group&gt;
       &lt;ge&gt;hello g3&lt;/ge&gt;
       &lt;ge&gt;hello g4&lt;/ge&gt;
    &lt;/group&gt;
  &lt;/element&gt;
  </code></pre>
  
  <p>I want to have elements with text convert into</p>
  
  <pre><code>&lt;div class="text_element"&gt;Hello StackOverFlow&lt;/div&gt;
  </code></pre>
  
  <p>and for those elements with child nodes:</p>
  
  <pre><code>&lt;div class="element"&gt;
    &lt;ul class="group"&gt;
       &lt;li&gt;hello g1&lt;/li&gt;
       &lt;li&gt;hello g2&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul class="group"&gt;
       &lt;li&gt;hello g3&lt;/li&gt;
       &lt;li&gt;hello g4&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, the problem is how can I distinguish these two kind of elements in writing the template?</p>