title: Reading in XML/KML files using C#
body: <p>I'm trying to import the kml xml Google earth file into an application, but i can't seem to get the xDocument syntax right in order to do what i want, i'm wondering if anyone could suggest a way to read in the kml xml file.</p>
  
  <p>I understand the basics of xml import but can't get anything working with xDocument and Linq, ideally i'd like to get each Placemark as an object and add them to my Entity Framework driven db. Any suggestions as to how i should do this would be great, as i'm just starting out with Linq and could do with some pointers. The xml is laid out as below</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;kml xmlns="http://earth.google.com/kml/2.2"&gt;
    &lt;Document&gt;
      &lt;Placemark&gt;
        &lt;name&gt;XXX&lt;/name&gt;
        &lt;description&gt;XXX&lt;/description&gt;
        &lt;styleUrl&gt;XXX&lt;/styleUrl&gt;
        &lt;Point&gt;
           &lt;coordinates&gt;XXX&lt;/coordinates&gt;
        &lt;/Point&gt;
      &lt;/Placemark&gt;
      &lt;Placemark&gt;
        &lt;name&gt;XXX&lt;/name&gt;
        &lt;description&gt;XXX&lt;/description&gt;
        &lt;styleUrl&gt;XXX&lt;/styleUrl&gt;
        &lt;Point&gt;
           &lt;coordinates&gt;XXX&lt;/coordinates&gt;
        &lt;/Point&gt;
      &lt;/Placemark&gt;
    &lt;/Document&gt;
  &lt;/kml&gt;
  </code></pre>