I've been working on a script that will pull the duration from sequences. I have successfully done this but there may be a bug.
When I place a clip on V2 that extends the timeline, the duration in the XML only reflects the duration of V1.
Here's what my timeline looks like with the in and out set to V1. You can see in the upper right the total number of frames shows 4023.
And the XML shows 4023 frames
However, the total duration should be 5240 frames:
How are you getting/computing the duration? Have you saved the project, between inserting the 'extend the timeline' clip, and exporting the FCP XML?