title: How to ignore a group of elements if a specific node does not exist XSLT
body: <p>I'm new to XSLT and I'm trying to transform</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;file&gt;
  &lt;files&gt;
  &lt;segmentpair&gt;
  &lt;source&gt;2. als Vertreter der xxxx ein Professor der Materialwissenschaft oder der Engineering Science und&lt;/source&gt;
  &lt;target&gt;2. as a representative of the University of xxxxx, a professor of materials science or engineering science&lt;/target&gt;
  &lt;Comments&gt;
  &lt;Comment&gt;[xxx 09.01.2014 15:09:23] some comment on the translation&lt;/Comment&gt;
  &lt;/Comments&gt;
  &lt;/segmentpair&gt;
  &lt;/files&gt;
  &lt;/file&gt;
  </code></pre>
  
  <p>into </p>
  
  <pre><code>&lt;Feedback&gt;[xxx 09.01.2014 15:09:23] some comment on the translation&lt;/Feedback&gt;
  &lt;Source&gt;2. als Vertreter der xxxx ein Professor der Materialwissenschaft oder der Engineering Science und&lt;/Source&gt;
  &lt;Target&gt;2. as a representative of the University of xxxxx, a professor of materials science or engineering science&lt;/Target&gt;
  </code></pre>
  
  <p>I'm just not sure what to use to not display the target and source elements if no comments are present. For each and if? This code was just an idea to test whether the node exists but I don't think this is the right way and it doesn't work.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
      &lt;xml:output method="xml" version="1.0"  indent="yes"/&gt;
      &lt;xsl:template match="/"&gt;
          &lt;document&gt;
  
              &lt;xsl:for-each select="/files/file/segmentpair"&gt;
              &lt;xsl:if test="Comments"&gt;
              &lt;feedback&gt;
                  &lt;xsl:value-of select="Comments/comment"/&gt;
              &lt;/feedback&gt;
  
           &lt;/xsl:if&gt;
           &lt;/xsl:for-each&gt;
          &lt;/document&gt;     
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I would be so grateful for help, I've read many examples here but I've got the point where I can't work out the most efficient way, I think I could be missing out on something simpler with XSLT 2.0. </p>
  
  <p>Thanks
  D.</p>