Here is the code I'm on. You can ignore the :Resource, its part of something I imported with neosemantics.
call apoc.load.xml("file:///NCT0017xxxx/NCT00170157.xml") yield value
with value._children as root
with [x in root where x._type = "clinical_results"][0]._children as clinicalresults,
\[x in root where x.\_type \= "id\_info"\]\[0\].\_children as idinfo
with [x in clinicalresults where x._type = "participant_flow"][0]._children as participantflow,
\[x in idinfo where x.\_type \= 'nct\_id'\]\[0\] as nctid
with [x in participantflow where x._type = 'period_list'][0]._children as periodlist,
nctid as nctid
with [x in periodlist where x._type = 'period'][0]._children as period,
nctid as nctid
with [x in period where x._type = 'title'][0] as title,
nctid as nctid ,
\[x in period where x.\_type \= 'milestone\_list'\]\[0\].\_children as milestonelist
with title as title,
nctid as nctid ,
\[x in milestonelist where x.\_type \= 'milestone'\]\[0\].\_children as milestone,
milestonelist as milestonelist
with title as title,
nctid as nctid,
\[x in milestone where x.\_type \= 'title'\]\[0\] as mstitle,
\[x in milestone where x.\_type \= 'participants\_list'\]\[0\].\_children as participantslist,
milestonelist as milestonelist
with
\[x in participantslist | x.group\_id\] as groupids,
\[x in participantslist | x.count\] as counts,
nctid as nctid,
title as title,
mstitle as mstitle,
participantslist as participantslist,
milestonelist as milestonelist
unwind range(0,size(milestonelist)-1) as y
//Milestonelist
forEach(x in milestonelist[y] | ????)
MERGE(p:Period{title_name: title._text})
MERGE(m:Milestone{title_name: mstitle._text})
MERGE(t:Trial{nct_id:nctid._text })
MERGE(r1:Resource{ns1__title:"Period"})
MERGE(r2:Resource{ns1__title:"name title"})
MERGE(r3:Resource{ns1__title:"Milestone"})
MERGE(r4:Resource{ns1__title:"Participant-Flow"})
MERGE(r5:Resource{ns1__title:"group id"})
MERGE(r6:Resource{ns1__title:"participant counts"})
//RELATIONS
MERGE (t)-[:CONTAIN]->(p)
MERGE (t)-[:CONTAIN]->(m)
MERGE (t)-[:CONTAIN]->(pa)
MERGE (p)-[:SCO]->(r1)
MERGE (pa)-[:SCO]->(r4)
MERGE (m)-[:SCO]->(r3)
MERGE (p)-[:INCLUDE]->(r2)
MERGE (m)-[:INCLUDE]->(r2)
MERGE (pa)-[:INCLUDE]->(r5)
MERGE (pa)-[:INCLUDE]->(r6)
MERGE (m)-[:IN]->(p)
//Participants
forEach(x in participantslist |
MERGE(pa:Participants{group_id: x.group_id, count: x.count})
MERGE (pa)-[:IN]->(m)
MERGE (t)-[:CONTAIN]->(pa)
)
*/