Solr will not keep the structure of your XML data. Solr and Lucene have a flat data model. You can map hierarchy into that, but it can be a lot of work.
I recommend starting with a dedicated XML database. MarkLogic is commercial, but they have added a free developer license that can be used for some production (see limitations here: http://community.marklogic.com/express). I would say to use "an XML database", but there really is no other production-ready XML database. eXist is nice, but it can be 100X slower than MarkLogic. I used to work at MarkLogic and I've implemented Solr at two major web companies. If you really want to work in XML, you'll be a lot happier with MarkLogic. wunder On Apr 27, 2012, at 7:31 AM, G.Long wrote: > Hi there :) > > I'm looking for a way to save xml files into some sort of database and i'm > wondering if Solr would fit my needs. > The xml files I want to save have a lot of child nodes which also contain > child nodes with multiple values. The depth level can be more than 10. > > After having indexed the files, I would like to be able to query for subparts > of those xml files and be able to reconstruct them as xml files with all > their children included. However, I'm wondering if it is possible with an > index like solr lucene to keep or easily recover the structure of my xml data? > > Thanks for your help, > > Regards, > > Gary