title: XLIFF conversion using XML
body: <p>I'm trying to convert a XLIFF file back into a proper xml file using this code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      &lt;xsl:template match="//body"&gt;
        &lt;xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1"&gt;
          &lt;file source-language="en-US" datatype="plaintext" target-language="de"&gt;
              &lt;body&gt;
                  &lt;xsl:for-each select="//trans-unit"&gt;
                      &lt;xsl:element name="string"&gt;
                          &lt;xsl:attribute name="name"&gt;&lt;xsl:value-of select="@id"/&gt;&lt;/xsl:attribute&gt;
                          &lt;xsl:value-of select="target"/&gt;
                      &lt;/xsl:element&gt;      
                  &lt;/xsl:for-each&gt;
              &lt;/body&gt;
          &lt;/file&gt;
      &lt;/xliff&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>But all it get as a return are the strings enclosed in the <code>&lt;source&gt;</code> and <code>&lt;target&gt;</code> tags. I'm doing something terribly wrong or i'm missing some special tag to do so?</p>
  
  <p>I was able to successfully create an XLIFF file using a simple XSLT script but I'm struggling to convert it back. </p>
  
  <p>Any ideas are appreciated.</p>
  
  <p>Regards,
  Thomas</p>
  
  <p>Here is an example of the xliff file</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1"&gt;
    &lt;file source-language="en" datatype="plaintext" target-language="de"&gt;
      &lt;body&gt;
        &lt;trans-unit xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:space="preserve" approved="yes" id="firstrun_textview_language_array_names1"&gt;
          &lt;source&gt;English&lt;/source&gt;
          &lt;target&gt;Englisch&lt;/target&gt;
        &lt;/trans-unit&gt;
        &lt;trans-unit xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:space="preserve" approved="no" id="firstrun_textview_language_array_names2"&gt;
          &lt;source&gt;Chinese (traditional)&lt;/source&gt;
          &lt;target&gt;i dont know&lt;/target&gt;
        &lt;/trans-unit&gt;
      &lt;/body&gt;
    &lt;/file&gt;
  &lt;/xliff&gt;
  </code></pre>