Implement more robust XRef position parsing