The translation of the inner IP header can be done by recursively invoking the function that translated the outer IP headers.
3.5. Knowing when to Translate
The translator is assumed to know the pool(s) of IPv4 address that are used to represent the internal IPv6-only nodes. Thus if the IPv4 destination field contains an address that falls in these configured sets of prefixes the packet needs to be translated to IPv6.
4. Translating from IPv6 to IPv4
When an IPv6-to-IPv4 translator receives an IPv6 datagram addressed to an IPv4-mapped IPv6 address, it translates the IPv6 header of that packet into an IPv4 header. It then forwards the packet based on the IPv4 destination address. The original IPv6 header on the packet is removed and replaced by an IPv4 header. Except for ICMP packets the transport layer header and data portion of the packet are left unchanged.
+-------------+ +-------------+ IPv6 IPv4 Header Header +-------------+ +-------------+ Fragment Transport Header ===> Layer (if present) Header