title: Extracting part of XMLType in PL/SQL because of repeating node inside another repeating mode
body: <p><br/>
  I have a XMLType object and I want to extract opening times into table.<br/></p>
  
  <pre><code>&lt;workspace&gt;
    &lt;title&gt;workspace1&lt;/title&gt;
    &lt;item&gt;
      &lt;day&gt;1&lt;/day&gt;
      &lt;openingTime&gt;8:00&lt;/openingTime&gt;
      &lt;closingTime&gt;12:00&lt;/closingTime&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;day&gt;1&lt;/day&gt;
      &lt;openingTime&gt;13:00&lt;/openingTime&gt;
      &lt;closingTime&gt;18:00&lt;/closingTime&gt;
    &lt;/item&gt;
  &lt;workspace&gt;
  &lt;workspace&gt;
    &lt;title&gt;workspace2&lt;/title&gt;
    &lt;item&gt;
      &lt;day&gt;1&lt;/day&gt;
      &lt;openingTime&gt;9:00&lt;/openingTime&gt;
      &lt;closingTime&gt;14:00&lt;/closingTime&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;day&gt;3&lt;/day&gt;
      &lt;openingTime&gt;12:00&lt;/openingTime&gt;
      &lt;closingTime&gt;16:00&lt;/closingTime&gt;
    &lt;/item&gt;
  &lt;workspace&gt;
  </code></pre>
  
  <p>I would use something like:</p>
  
  <pre><code>SELECT ExtractValue(Value(p),'workspace/item/day/text()') as day
        ,ExtractValue(Value(p),'workspace/item/openingTime/text()') as open
        ,ExtractValue(Value(p),'workspace/item/closingTime/text()') as close
        FROM TABLE (XMLSequence(Extract(y,'workspace'))) p
        WHERE ExtractValue(Value(p),'/workspace/title/text()') LIKE 'workspace1';
  </code></pre>
  
  <p>where <b>y</b> is XMLType above. But that won't work, because it will still find more than one <b>item</b> node. I need to extract ALL element values for title workspace2 (values 1, 9:00, 14:00, 3, 12:00, 16:00). It would help if I could extract not only value, but whole part of XMLType. Any ideas?
  <br/>
  Thanks, Michal</p>