title: How to convert datetime to ISO 8601 format
body: <p>I have a date value in a field in XML file in this format:</p>
  
  <pre><code>&lt;date&gt;2017-05-01 00:00:00&lt;/date&gt;
  </code></pre>
  
  <p>I want to convert it into a standard XSD format:</p>
  
  <pre><code>2017-05-01T00:00:00.000Z
  </code></pre>
  
  <p>I'm currently using version 3.0.</p>
  
  <p>My stylesheet</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  version="3.0"&gt;
  &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
  
  &lt;xsl:template match="@*|node()"&gt;
      &lt;xsl:apply-templates select="node()" /&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:variable name="theDate" select="/item/date" /&gt;
  
  &lt;xsl:template match="/" name="xsl:initial-template"&gt;
      &lt;Bundle&gt;
          &lt;thedate&gt;
              &lt;xsl:attribute name="value"&gt;&lt;xsl:value-of select="$theDate"/&gt;&lt;/xsl:attribute&gt;
          &lt;/thedate&gt;
      &lt;/Bundle&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>XML input</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;item&gt;
      &lt;date&gt;2017-05-01 00:00:00&lt;/date&gt; 
  &lt;/item&gt;
  </code></pre>
  
  <p>Would like output to look like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Bundle xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;thedate value="2017-05-01T00:00:00.000Z"/&gt;
  &lt;/Bundle&gt;
  </code></pre>