docs: @SuppressWarnings("unchecked")
      public static <T, S extends T> T transform(final Object xmlNodeOrJsonMap, final Class<T> valueType,
                                                 final S defaultObject, final JAXBContext jaxbContext,
                                                 final ObjectMapper objectMapper) throws Exception { // NOSONAR
  
          if (xmlNodeOrJsonMap == null) {
              return defaultObject;
          }
          Validate.notNull(valueType, "valueType must not be null"); // NOSONAR
          if (valueType.isAssignableFrom(xmlNodeOrJsonMap.getClass())) {
              return valueType.cast(xmlNodeOrJsonMap);
          }
          if (xmlNodeOrJsonMap instanceof Node) {
              return xmlNodeToObject((Node) xmlNodeOrJsonMap, valueType, jaxbContext);
          }
          if (xmlNodeOrJsonMap instanceof Map) {
              return jsonMapToObject((Map<String, Object>) xmlNodeOrJsonMap, valueType, objectMapper);
          }
          throw new IllegalArgumentException("xmlNodeOrJsonMap must be of type " + valueType + ", " + Node.class.getName()
                  + " or of type " + Map.class.getName());
      }