should likely use ``ClassUtils::getClass($document)`` to determine the class