OK, so here we go for the tracks:
1. Replace the broken header with <gpx> and add the final </gpx> tag at the end of the file as above
2. Fix the erroneous capitalization of the trk element by replacing all the occurences of "
TRK" with "
trk"
3. Add the missing </trk> tag at the end of each track by replacing all the occurences of "
</trkseg>" with "
</trkseg></trk>" (here I hope all the tracks have only one segment as in your sample, otherwise this will result in broken GPX file)
4. Fix the broken trkpt tags by replacing all the occurences of "
"</trkpt>" with "
"></trkpt>" (Yes, the doublequote is part of the string)
If they have thousands of tracks and actually used colors and line styles for them, you may probably want to also do something about the proprietary (and erroneously implemented) extensions in the file (tags cmt, color and width) - Look at a GPX file containing a track with color and line style exported from
OpenCPN to see the valid GPX extension implementation into which you would have to transform it.