Add check for JAXBElement when determining object references.