private T unmarshallPrimitive(VElement elem) throws ClassNotFoundException,
          InstantiationException, IllegalAccessException,
          NoSuchMethodException, IllegalArgumentException,
          InvocationTargetException {
    String wr = elem.getAttribute(
            VMarshallerConstants.PRIMITIVE_WRAPPER_ATTRIBUTE).getValue();
    String value = elem.toContent();
    Object o = null;
    if (value.length() != 0) {
      Object ob = Class.forName(wr)
              .getConstructor(new Class[]{String.class})
              .newInstance(new Object[]{"0"});
      if (ob instanceof Integer) {
        o = Integer.parseInt(value);
      } else if (ob instanceof Long) {
        o = Long.parseLong(value);
      } else if (ob instanceof Double) {
        o = Double.parseDouble(value);
      } else if (ob instanceof Float) {
        o = Float.parseFloat(value);
      } else if (ob instanceof Byte) {
        o = Byte.parseByte(value);
      } else if (ob instanceof Short) {
        o = Short.parseShort(value);
      } else if (ob instanceof Character) {
        value = value.trim();
        o = value.charAt(0);
      }
    }
    VAttribute at = elem
            .getAttribute(VMarshallerConstants.OBJECT_REFERENCE_ID_ATTRIBUTE);
    if (at != null) {
      String val = at.getValue();
      long id = Long.parseLong(val);
      idMapping.put(id, o);
    }
    return (T) o;
  }