public static Class toReturnType(QName resultType,Class optionalCastToType){
  if (optionalCastToType != null) {
    return optionalCastToType;
  }
  if (resultType.equals(XPathConstants.NODESET))   return NodeList.class;
  if (resultType.equals(XPathConstants.NODE))   return Node.class;
  if (resultType.equals(XPathConstants.BOOLEAN))   return Boolean.class;
  if (resultType.equals(XPathConstants.NUMBER))   return Double.class;
  if (resultType.equals(XPathConstants.STRING))   return String.class;
  return String.class;
}

public static Class toReturnType ( QName resultType , Class optionalCastToType ) { if ( optionalCastToType != null ) { return optionalCastToType ; } if ( resultType . equals ( XPathConstants . NODESET ) ) return NodeList . class ; if ( resultType . equals ( XPathConstants . NODE ) ) return Node . class ; if ( resultType . equals ( XPathConstants . BOOLEAN ) ) return Boolean . class ; if ( resultType . equals ( XPathConstants . NUMBER ) ) return Double . class ; if ( resultType . equals ( XPathConstants . STRING ) ) return String . class ; return String . class ; }
returns the native type based on xpathconstants qname and an optional cast - to type , if provided .
