Importing nested XML using Feeds XPath Parser I have some XML formatted as such:

&lt;item&gt;
    &lt;title&gt;Name&lt;/title&gt;
    &lt;id&gt;12&lt;/id&gt;
    &lt;upgrade&gt;
        &lt;id&gt;13&lt;/id&gt;
        &lt;level&gt;2&lt;/level&gt;
    &lt;/upgrade&gt;
    &lt;upgrade&gt;
        &lt;id&gt;14&lt;/id&gt;
        &lt;level&gt;3&lt;/level&gt;
    &lt;/upgrade&gt;
&lt;/item&gt;


Ultimately from this example I want 3 nodes:


Title: "Name (1)" GUID: 12
Title: "Name (2)" GUID: 13
Title: "Name (3)" GUID: 14


I'm quite happy to do 2 runs of the file if necessary. I have one importer at the moment which sets up the "Name (1)" items. This works perfectly.

I have a second importer set up which I can successfully create the secondary "upgrade" nodes but only if I use \item\upgrade as the context, at which point I lose the title element so the nodes come through as " (2)", " (3)" etc.

If I use \item as the context like the initial importer, I can't seem to loop through the upgrade XML nodes.
Answered on drupal.org

Import will need to be done using the context \\item\upgrade.

Then to target the title from the parent node, use ..\title.