title: How to change the format of all dates in xml?
body: <p>I have an xml in a cell in SQL, like:</p>
  
  <p>Table:</p>
  
  <p><img src="https://i.stack.imgur.com/YYswK.png" alt="table"></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-16"?&gt;
      &lt;Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
        &lt;Page W="2480" H="3516"&gt;
              &lt;Word L="1871" R="2031" T="221" B="252" Text="INVOICE" Id="25509747671106" /&gt;
              &lt;Word L="1988" R="2046" T="2232" B="2279" Text="tf.'l" Id="25886807122412" /&gt;
              &lt;Word L="1872" R="1990" T="324" B="351" Text="26603333345"Id="24493329746300" /&gt;
              &lt;Word L="1871" R="2015" T="373" B="401" Text="08-02-17" Id="25109308586898" /&gt;
              &lt;Word L="1873" R="2007" T="422" B="448" Text="S-44404" Id="24914704754685" /&gt;
              &lt;Word L="1874" R="1887" T="468" B="496" Text="1" Id="22024234663427" /&gt;
              &lt;Word L="1068" R="1148" T="1278" B="1309" Text="DHL" Id="8152496756181" /&gt;
              &lt;Word L="1692" R="1848" T="1279" B="1310" Text="08-02-17" Id="21119731019927" /&gt;
              &lt;Word L="2096" R="2251" T="1278" B="1310" Text="10-01-17" Id="31333127836454" /&gt;
              &lt;Word L="112" R="243" T="1352" B="1358" Text="_" Id="365589546232" /&gt;
              &lt;Word L="252" R="411" T="1322" B="1350" Text="QUANTITY" Id="1050334834310" /&gt;
              &lt;Word L="1415" R="1913" T="745" B="787" Text="______ShlpTo" Id="22635743273663" /&gt;
       &lt;/Page&gt;
     &lt;/Document&gt;
  </code></pre>
  
  <p>I need to update [FRData] and change the date from format <strong>mm-dd-yy</strong> to format <strong>yyyy-mm-dd</strong> in all xml.</p>
  
  <p>I wrote a regular expression that validates the date format sought:</p>
  
  <pre><code>^(0?[1-9]|1[012])[\-](0?[1-9]|[12][0-9]|3[01])[\-]\d{2}$
  </code></pre>
  
  <p>I know how to change the date format <strong>mm-dd-yy</strong> to <strong>yyyy-mm-dd</strong>:</p>
  
  <pre><code>select left(convert(varchar, cast('08-02-17' as datetime), 120),10)
  </code></pre>
  
  <p>But I do not know how to change dates in the entire xml</p>