code: private Class getPrimativeClass(Object obj)
    {
  
      if (obj instanceof XPath)
        return XPath.class;
  
      Class cl = obj.getClass();
  
      if (cl == Double.class)
      {
        cl = double.class;
      }
  
      if (cl == Float.class)
      {
        cl = float.class;
      }
      else if (cl == Boolean.class)
      {
        cl = boolean.class;
      }
      else if (cl == Byte.class)
      {
        cl = byte.class;
      }
      else if (cl == Character.class)
      {
        cl = char.class;
      }
      else if (cl == Short.class)
      {
        cl = short.class;
      }
      else if (cl == Integer.class)
      {
        cl = int.class;
      }
      else if (cl == Long.class)
      {
        cl = long.class;
      }
  
      return cl;
    }
docs: Get the primative type for the class, if there
  is one.  If the class is a Double, for instance,
  this will return double.class.  If the class is not one
  of the 9 primative types, it will return the same
  class that was passed in.
  
  @param obj The object which will be resolved to a primative class object if possible.
  
  @return The most primative class representation possible for the object, never null.