title: Converting Complex XML to CSV
body: <p>I have some (complex to me) XML code that I need to convert into CSV, I need absolutely every value added to the CSV for every submission, I have tried a few basic things however I cant get past the deep nesting and the different structures of this file.</p>
  
  <p>Could someone please help me with a powershell script that would, I have started but cannot get the output of all data out I only get Canvas Results</p>
  
  <p><a href="https://onedrive.live.com/embed?cid=EEDE5D9428857351&amp;resid=EEDE5D9428857351%2115287&amp;authkey=ADToQBkPSxy1l8A" rel="nofollow">Submissions.xml</a> To large to post here (102KB)</p>
  
  <pre><code>$d=([xml](gc submissions.xml)).CANVASRESULTS | % { 
    foreach ($i in $_.CANVASRESULTS) {
      $o = New-Object Object
      Add-Member -InputObject $o -MemberType NoteProperty -Name Submissions -Value $_.Submission
      Add-Member -InputObject $o -MemberType NoteProperty -Name Submission -Value $i
      $o
    }
  }
  $d | ConvertTo-Csv -NoTypeInformation -Delimiter ","
  </code></pre>