XML to Array

Hello!

I need to build an array based on this XML structure



		<student>
			<name></name>
			<pic></pic>
		</student>
		<student>
			<name></name>
			<pic></pic>
			<pic></pic>
			<pic></pic>
		</student>
		<student>
			<name></name>
			<pic></pic>
			<pic></pic>
		</student>

So that it would give me something like the image attached.

The complexity comes from the fact a “student” can have several “pic”.
In my actual for loop, I get errors or only partial results.

Your ideas would be greatly appreciated.

I need to be able to always trace a given pic belongs to the student’s name.

Many many thanks!