title: Find maximum value of attribute with Groovy XmlSlurper
body: <p>Given xml:</p>
  
  <pre><code>&lt;d&gt;
      &lt;r1 dt="2011-06-10"&gt;
          &lt;r11 dt="2012-07-10" /&gt;
          &lt;r12 rdt="2011-10-11"&gt;
              &lt;r121 dt="2010-05-13" /&gt;
          &lt;/r12&gt;
      &lt;/r1&gt;
      &lt;r2&gt;
          &lt;r21 dt="2011-10-10"&gt;&lt;n2 ddt="2012-11-31"/&gt;dt&lt;/r21&gt;
          &lt;r22 dt="2013-07-10"&gt;&lt;n2 ddt="2013-06-31"/&gt;dt&lt;/r22&gt;
          &lt;r23 dt="2014-06-10"&gt;&lt;n2 ddt="2014-03-31"/&gt;dt&lt;/r23&gt;
          &lt;r24 dt="2015-06-10"&gt;&lt;n2 ddt="2011-10-31"/&gt;dt&lt;/r24&gt;
      &lt;/r2&gt;
  &lt;/d&gt;
  </code></pre>
  
  <p>I need to find value among attributes <code>dt</code>, <code>rdt</code> and <code>ddt</code> that has maximum date using <strong>Groovy XmlSlurper</strong>. In the given example it will be <code>2015-06-10</code>. Suppose xml tree structure and deep is unknown (varies). Is it possible to do it using <code>onliner</code>, or should I do some iterations in my code?</p>