Migrating compound data structures from XML
Migrate can help you with this. 

You can extend XMLMigration and use MigrateSourceXML.

I have a partial stack exchange data import which uses this with code on github.