It looks like an interesting problem. You could probably use something like nc to read the data, then pipe that through perl, unpack() the data, then print that out to an XML file. You might want to have a rolling list of files, say 5 or so, to avoid synchronization issues.
It would be something along the lines of:
nc -l -u 4000 | perl -e '$i=0; while(<>) { ($time, $car, $flags, $gear, $spareB, $speed, $rpm, $turbo, $engtemp, $fuel, $oilpress, $spare1, $spare2, $spare3, $throttle, $brake, $clutch, $display1, $display2, $id) = unpack("Ic4IccffffffffffffC16C16I", $_); open(my $f, ">", "/tmp/lfs-" . (($i)%5) . ".xml"); print $f "<tag time=\"$time\" car=\"$car\" flags=\"$flags\" gear=\"$gear\" spareb=\"$spareb\" speed=\"$speed\" rpm=\"$rpm\" turbo=\"$turbo\" engtemp=\"$engtemp\" fuel=\"$fuel\" oilpress=\"$oilpress\" spare1=\"$spare1\" spare2=\"$spare2\" spare3=\"$spare3\" throttle=\"$throttle\" brake=\"$brake\" clutch=\"$clutch\" display1=\"$display1\" display2=\"$display2\"/>\n"; close($f); open(my $f, ">", "/tmp/current-file"); print $f (($i++)%5); close($f); }'
Then you read /tmp/current-file, figure out what the latest file is, then open /tmp/lfs-$currentfile, and read everything in.
I'm not sure if netcat will work, though. Give it a shot and see what happens. Try just running
and seeing if any data comes out of it. If it does, you know it's an approach you can take.