title: Level: Hard - Extract data from XML in a hierarchy format
body: <p>I've researched and have not come up with anyone doing anything like this.  I'm open to suggestions.  Right now I am trying to load a table described below.</p>
  
  <pre><code>    CREATE TABLE [Course].[Navigation](
          [NavigationId] [int] IDENTITY(1,1) NOT NULL,
          [ParentID] [int],
          [ChildID] [int], 
          [Type] [varchar](100) NULL,
          [Label] [int] NULL,
          [Id] [varchar](100) NULL )
  </code></pre>
  
  <p>Which represents a navigational chart for a course.</p>
  
  <p>The XML that I'm trying to load is:</p>
  
  <pre><code>        &lt;navigation&gt;
              &lt;content label="Introduction"&gt;
                  &lt;content label="Intro" id="000286_1001"/&gt;&lt;/content&gt;
              &lt;content label="Premature Atrial Contractions"&gt;
                  &lt;content label="Description" id="000286_1002"/&gt;
                  &lt;content label="ECG Features" id="000286_1003"/&gt;
                  &lt;content label="Etiology/Symptoms/Treatment" id="000286_1004"/&gt;&lt;/content&gt;
              &lt;content label="Wandering"&gt;
                  &lt;content label="Description" id="000286_1005"/&gt;
                  &lt;content label="ECG Features" id="000286_1006"/&gt;
                  &lt;content label="Etiology/Symptoms/Treatment" id="000286_1007"/&gt;&lt;/content&gt;
              &lt;content label="Ectopic Atrial Rhythm"&gt;
                  &lt;content label="Description" id="000286_1008"/&gt;
                  &lt;content label="ECG Features" id="000286_1009"/&gt;
                  &lt;content label="Etiology/Symptoms/Treatment" id="000286_1010"/&gt;&lt;/content&gt;
              &lt;content label="Supraventricular Tachycardia"&gt;
                  &lt;content label="SVT" id="000286_1011"/&gt;
                  &lt;content label="Etiology/Symptoms/Treatment" id="000286_1012"/&gt;
                  &lt;content label="Multifocal Atrial Tachycardia"&gt;
                      &lt;content label="Description" id="000286_1013"/&gt;
                      &lt;content label="ECG Features" id="000286_1014"/&gt;
                      &lt;content label="Etiology/Symptoms/Treatment" id="000286_1015"/&gt;&lt;/content&gt;
                  &lt;content label="Ectopic Atrial Tachycardia"&gt;
                      &lt;content label="Description" id="000286_1016"/&gt;
                      &lt;content label="ECG Features" id="000286_1017"/&gt;
                      &lt;content label="Etiology/Symptoms/Treatment" id="000286_1018"/&gt;&lt;/content&gt;
                  &lt;content label="Ectopic Atrial Tachycardia with Block"&gt;
                      &lt;content label="Description" id="000286_1019"/&gt;&lt;/content&gt;
                  &lt;content label="Atrial Flutter"&gt;
                      &lt;content label="Description" id="000286_1020"/&gt;
                      &lt;content label="ECG Features" id="000286_1021"/&gt;
                      &lt;content label="Etiology/Symptoms/Treatment" id="000286_1022"/&gt;
                      &lt;content label="Treatment" id="000286_1023"/&gt;&lt;/content&gt;
                  &lt;content label="Atrial Fibrillation"&gt;
                      &lt;content label="Description" id="000286_1024"/&gt;
                      &lt;content label="ECG Features" id="000286_1025"/&gt;
                      &lt;content label="Etiology/Symptoms/Treatment" id="000286_1026"/&gt;
                      &lt;content label="Signs" id="000286_1027"/&gt;
                      &lt;content label="Treatment" id="000286_1028"/&gt;&lt;/content&gt;
                  &lt;content label="AVRT"&gt;
                      &lt;content label="Description" id="000286_1029"/&gt;
                      &lt;content label="Pathophysiology" id="000286_1030"/&gt;
                      &lt;content label="ECG Features" id="000286_1031"/&gt;
                      &lt;content label="Etiology" id="000286_1032"/&gt;&lt;/content&gt;
                  &lt;content label="AVNRT"&gt;
                      &lt;content label="Description" id="000286_1033"/&gt;
                      &lt;content label="ECG Features" id="000286_1034"/&gt;
                      &lt;content label="Etiology" id="000286_1035"/&gt;&lt;/content&gt;
                  &lt;content label="Treatment" id="000286_1036"/&gt;&lt;/content&gt;
              &lt;content label="Review"&gt;
                  &lt;content label="Quick Quiz" id="000286_1037"/&gt;&lt;/content&gt;
              &lt;content label="Conclusion"&gt;
                  &lt;content label="Summary" id="000286_1038"/&gt;&lt;/content&gt;
          &lt;/navigation&gt;
  </code></pre>