Loop over all children of a space

Hello,

We are trying to migrate from Confluence and the macro time is not recognized by Xwiki when importing spaces.
So I’m trying to create an application to change each macro like this one <time datetime="2021-01-29" class="date-past">29 Jan. 2021</time\> into an Xwiki date/time format.

I’m having trouble with the first step: going through all the children in the space to inspect their content.
Do you have any ideas on how to do this? Or a better solution to fix the missing time macro? I’m fairly new to Xwiki…

Thanks, Quentin