title: Find element that has both children and string in xslt
body: <p>My source is:</p>
  
  <pre><code>&lt;content&gt;
    &lt;caption&gt;text 1&lt;/caption&gt;
    &lt;element1&gt;Notepad is a basic text-editing program and it's most commonly used to view or edit text files. A text &lt;bold&gt;file&lt;/bold&gt; is a &lt;a&gt;file&lt;/a&gt; type typically identified by the .txt file name extension.&lt;/element1&gt;
    &lt;section1&gt;
       &lt;element2&gt;Notepad is a basic text-editing program and it's most commonly used to view or edit text files. A text file is a file type typically identified by the .txt file name extension.&lt;/element2&gt;
     &lt;/section1&gt;
   &lt;/content&gt;
  </code></pre>
  
  <p>I am trying to extract and create unique ID for the elements (it may be any element) which has both child (character elements) and text, and also the elements which has only text. The <code>&lt;bold&gt;</code> and <code>&lt;a&gt;</code> elements should not be seperated.</p>
  
  <pre><code>  &lt;caption id="id1"&gt;Text 1&lt;/caption&gt;
    &lt;element1 id="id2"&gt;Notepad is a basic text-editing program and it's most commonly used to view or edit text files. A text &lt;bold&gt;file&lt;/bold&gt; is a &lt;a&gt;file&lt;/a&gt; type typically identified by the .txt file name extension.&lt;/element1&gt;
    &lt;element2 id="id3"&gt;Notepad....&lt;/element2&gt;
  </code></pre>
  
  <p>Any idea would be greatly appreciated...</p>