I would suggest the following for consistency:
- Regular flights: As-Is
- True Codeshares: Record under operating carrier code & flight number
- Pseudo-Codeshares & Wet Leases: Record under the marketing carrier code & flight number
Your case (DL, operated by a XJ pseudo-codeshare) would fall under scenario #3.
I've been doing #1 and #2 as KVS described, but for #3, I've been recording under the wet lease carrier's code and flight number.
It's not a perfect solution, since it screws up the statistics of number of miles/segments on a given airline, but recording it under the marketing carrier isn't a perfect solution either.
Perhaps the FlightMemory guy[s] can add a codeshare field to the flight data entry page (haha...yet MORE data to enter!!

), which will allow you to generate statistics for total mileage by marketing carrier and total mileage by operating carrier.