title: How to best extract attribute values and element values with LINQ and C#
body: <p>Before i start this is my first post, so if there is something i have done wrong or not done please tell me and i'll edit my post</p>
  
  <p>I have a document which is formated as follows. </p>
  
  <pre><code>&lt;Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'&gt;
      &lt;EventData&gt;
          &lt;Data Name='SubjectUserSid'&gt;S-1-0-0&lt;/Data&gt;
          &lt;Data Name='SubjectUserName'&gt;MACHINE$&lt;/Data&gt;
          &lt;Data Name='SubjectDomainName'&gt;DOMAIN&lt;/Data&gt;
          &lt;Data Name='SubjectLogonId'&gt;0x0&lt;/Data&gt;
          &lt;Data Name='TargetUserSid'&gt;S-1-0-0&lt;/Data&gt;
          &lt;Data Name='TargetUserName'&gt;username&lt;/Data&gt;
          &lt;Data Name='TargetDomainName'&gt;TDname&lt;/Data&gt;
          &lt;Data Name='Status'&gt;0x0&lt;/Data&gt;
          &lt;Data Name='FailureReason'&gt;%%2313&lt;/Data&gt;
          &lt;Data Name='SubStatus'&gt;0x0&lt;/Data&gt;
          &lt;Data Name='LogonType'&gt;10&lt;/Data&gt;
      &lt;/EventData&gt;
  &lt;/Event&gt;
  </code></pre>
  
  <p>I have a little problem comming up with something that can extract the values from the XML (both the attribute values and the corresponding element values). Do i need a statement for each of the attribute or can i return a list and just loop over the values? </p>
  
  <p>EDIT: The values needs to be extracted so i can send them to a database. I would like to try using LINQ for this, but Xpath might work aswell </p>
  
  <p>EDIT2: Thank you for three good answers, i don't have the req. reputation to upvote answers yet and i need to get to my dev machine before testing, but this really looks what im looking for :)</p>