title: Cannot convert value class net.sf.saxon.tinytree.TinyElementImpl of type element(transactionDate, xs:anyType) to class java.util.Date
body: <p>We have a use-case where we are calling java static methods from Xslt template. We are passing some arguments in the method call. One of the argument is java.util.Date. During testing, I am seeing this particular exception :</p>
  <p><code>Cannot convert value class net.sf.saxon.tinytree.TinyElementImpl of type element(transactionDate, xs:anyType) to class java.util.Date</code></p>
  <p>Could not find anything why it's failing.</p>
  <p>Java Object :</p>
  <pre><code>   public Double getValue(String s1, String s2, Date d1) {
      // perform some operation.
      Double response = 2.0;
      return response;
     }
  </code></pre>
  <p>Xslt template : Added :</p>
  <pre><code>   &lt;xsl:stylesheet
          xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
          xmlns:barcode=&quot;http://barcode4j.krysalis.org/ns&quot;
          xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;
          xmlns:internal=&quot;http://internal.project.org&quot;
          xmlns:fox=&quot;http://xmlgraphics.apache.org/fop/extensions&quot;
          xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
          xmlns:date=&quot;http://exslt.org/dates-and-times&quot;
          xmlns:exsl=&quot;http://exslt.org/common&quot;
          extension-element-prefixes=&quot;exsl&quot;
          xmlns:util=&quot;java:com.personal.utils.DateUtil&quot;
          version=&quot;2.0&quot;&gt;
  
      &lt;xsl:variable name=&quot;country1&quot; select=&quot;/data/country&quot;/&gt;
      &lt;xsl:variable name=&quot;country2&quot; select=&quot;'US'&quot;/&gt;
      &lt;xsl:variable name=&quot;orderDate&quot; select=&quot;/data/transactionDate&quot;/&gt;
      &lt;xsl:variable name=&quot;currencyToPrint&quot;&gt;
              &lt;xsl:value-of select=&quot;getValue($country1, $country2, $orderDate)&quot;/&gt;
      &lt;/xsl:variable&gt;
  </code></pre>
  <p>Can someone please help what is causing this exception, why it's not able to convert to java.util.Date ?</p>