title: Preserving Newlines and Spaces in WordProcessingML using XSLT transform
body: <p>I am creating word documents programmatically using WordprocessingML and cannot find a way to preserve newlines in my text (w:t) blocks.  There is an answer at <a href="https://stackoverflow.com/questions/9241756/cannot-preserve-space-between-runs">cannot preserve space between runs</a> that addresses spaces by:</p>
  
  <pre><code>t = new Text()
  {
      Text = "your text with spaces ",
      Space = SpaceProcessingModeValues.Preserve
  };
  </code></pre>
  
  <p>I am, however, using a JavaScript file that creates the directory structure of the docx file and runs an xslt transformation on a source xml file to generate the primary document.xml file that word uses.  I'm unsure if I have the actual low-level WordprocessingML attributes that correspond to the code above.  I have tried:</p>
  
  <pre><code>&lt;w:t xml:space="preserve"&gt;
       Doesn't work.&lt;/w:t&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;w:t w:space="preserve"&gt; 
        Also, no joy.&lt;/w:t&gt;
  </code></pre>
  
  <p>Can this be done, or are multiple paragraph (w:p) tags required?  For ease of use, I would prefer the editors of the source xml file to just put the desired whitespace in a single text tag vs. having them manually add additional xml tags like tab or paragraph.</p>