title: How to get first element by XPath in Oracle
body: <p>In my Oracle db I have records like this one:</p>
  
  <pre><code>&lt;ROOT&gt;
    &lt;Event&gt;
      &lt;Type&gt;sldkfvjhkljh&lt;/Type&gt;
      &lt;ID&gt;591252&lt;/ID&gt;
    &lt;/Event&gt;
    &lt;Data&gt;
      &lt;File&gt;
        &lt;Name&gt;1418688.pdf&lt;/Name&gt;
        &lt;URL&gt;/591252/1418688.pdf&lt;/URL&gt;
      &lt;/File&gt;
      &lt;File&gt;
        &lt;Name&gt;1418688.xml&lt;/Name&gt;
        &lt;URL&gt;/591252/1418688.xml&lt;/URL&gt;
      &lt;/File&gt;
    &lt;/Data&gt;
  &lt;/ROOT&gt;
  </code></pre>
  
  <p>I need to extract a value from the first <code>&lt;Name&gt;</code> tag. If I try:</p>
  
  <pre><code>Select xmltype(xml_data).extract('//Name[1]/text()').getStringVal() from MY_TABLE
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>1418688.pdf1418688.xml</p>
  </blockquote>
  
  <p>Why is that and how can I get just <code>1418688.pdf</code>?</p>
  
  <p>Oracle Version:</p>
  
  <blockquote>
    <p>Oracle Database 10g Enterprise Edition
    Release 10.2.0.4.0 - 64bi</p>
  </blockquote>