You can use
formatDateTime($Entity/dateTime, 'yyyy-MM-dd') + 'T' + formatDateTime($Entity/dateTime, 'HH:mm:ss.SSS') + 'Z'
Chris, Ronald,
Below is a modelshare of the flow I'm using. The DateTime variable is set in the 'Create String Variable' action. The result of the value after debugging, is shown below the modelshare
https://modelshare.mendix.com/models/ea279d19-64c2-417d-aaf3-e94cde507b73/storemeasurement
Another option would be to change the wsdl of the consumed webservice. Since the format matches the datetime format that mendix uses you could just fake that it is a datetime attribute while in reality it is a string. That way you would not have to do any conversion you just map your datetime attribute from your domainmodel.