title: Import Java Custom Method in Xquery
body: <p>I am using Weblogic Integration framework. While transforming one XML format to another using .xq file, I want to apply some logic written in a custom Java Class. </p>
  
  <p>For example, XML1 has tag: <code>&lt;UnitCode&gt;XYZ&lt;/UnitCode&gt;</code></p>
  
  <p>Custom Java Class: </p>
  
  <pre><code>public class unitcodemapper{
  public static String getMappedUnitCode(String unitCode){
      if(unitCode=="XYZ")
         return &lt;&lt;value from DB table&gt;&gt;
      else
         return unitCode;
  }
  }
  </code></pre>
  
  <p>XML2 will have a tag: <code>&lt;UnitCode&gt;unitcodemapper.getMappedUnitCode(XML1/UnitCode)&lt;/UnitCode&gt;</code></p>
  
  <p>I cannot find any documentation or example to do this. Can someone please help in understanding how this can be done?</p>