title: xquery fn:current-date() formate
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;library&gt;
      &lt;books&gt;
          &lt;book&gt;
              &lt;title&gt;The Story of my Life &lt;/title&gt;
              &lt;accessionNumber val="1"/&gt;
          &lt;/book&gt;
          &lt;book&gt;
              &lt;title&gt;XML Schema &lt;/title&gt;
              &lt;accessionNumber val="2"/&gt;
          &lt;/book&gt;
          &lt;book&gt;
              &lt;title&gt;C++ for Image processing&lt;/title&gt;
              &lt;accessionNumber val="3"/&gt;
          &lt;/book&gt;
      &lt;/books&gt;
      &lt;loans&gt;
          &lt;loan book="1" user="35" dueDate="25-April-2010"/&gt;
      &lt;/loans&gt;
      &lt;loans&gt;
          &lt;loan book="3" user="400" dueDate="05-Jan-2010"/&gt;
      &lt;/loans&gt;
      &lt;loans&gt;
          &lt;loan book="2" user="02" dueDate="25-Feb-2010"/&gt;
      &lt;/loans&gt;
      &lt;users&gt;
          &lt;user&gt;
              &lt;name&gt;Fred Jame&lt;/name&gt;
              &lt;id val="35"/&gt;
          &lt;/user&gt;
          &lt;user&gt;
              &lt;name&gt;Ashley&lt;/name&gt;
              &lt;id val="400"/&gt;
          &lt;/user&gt;
          &lt;user&gt;
              &lt;name&gt;Patrick&lt;/name&gt;
              &lt;id val="02"/&gt;
          &lt;/user&gt;
      &lt;/users&gt;
  &lt;/library&gt;
  </code></pre>
  
  <p>My tasks is to write XQuery Expression which list all users whose loan is overdue.</p>
  
  <p>I have to use <code>fn:current-date()</code> function to compare with <code>dueDate</code> to find out all overdue users but problem here is <code>fn:current-date()</code> format and <code>dueDate</code> format in XML document is totally different.</p>
  
  <p>How can I format it to get my desire result?</p>
  
  <pre><code>for $x in doc("library.xml")/library
  where  $x/@dueDate &gt; fn:current-date()
  return $x/@name
  </code></pre>
  
  <p>I tried above but <code>fn:current-date()</code> giving date output as <code>2014-03-30Z</code></p>
  
  <p>but I need to compare dueDate with current date if dueDate is above the Current-Date, then shows all  users.</p>