I'm not sure how this will work out, recursively. Probably a huge performance hit and memory exhaustion leading to the parent page non-rendering at all. But, here is an outline of how you could do this (in pseudo EE code):
{!-- Parent template --}
Let's get our child ids.
{exp:channel:entries entry_id='{structure:child_ids}' fixed_order="{structure:child_ids}"}
{embed='template_group/child_page_template' id='{child_id}'}
{/exp:channel:entries}
{!-- Child template normally used to show regular child page --}
Let's show our page, but load our channel loop depending on context.
{if embed:child_id}
If passing an embed id...
{exp:channel:entries id='{embed:child_id}' ... }
{if:else}
If not, see if it's a normal structure page...
{exp:channel:entries id='{structure:page_id}' ... }
{/if}
Render it up!
{/exp:channel:entries}
I guess another solution would be to write an add-on that just CURLS the page via AJAX and then returns it to your template. Or, what would be even easier (if this is an option for you), just use the nav
tag to dump URLs into iframes
: http://buildwithstructure.com/documentation/navigation_examples/
If you could explain the context of this desired output and a slightly more specific example (like, COMPLETE child page renders, header+footer and all?), we can probably help more.