title: Replace value of an empty node with 0
body: <p>The following is my sample XML:</p>
  
  <pre><code>&lt;root&gt;
      &lt;item&gt;old_value&lt;/item&gt;
      &lt;item/&gt;
  &lt;root&gt;
  </code></pre>
  
  <p>I have a table with XML data in an XMLTYPE column and I have so far managed to query the rows which have at least one empty <code>item</code> node, like the one shown above.</p>
  
  <p>Now, I want to replace the empty node with <code>&lt;item&gt;0&lt;/item&gt;</code> so that my XML looks like:</p>
  
  <pre><code>&lt;root&gt;
      &lt;item&gt;old_value&lt;/item&gt;
      &lt;item&gt;0&lt;/item&gt;
  &lt;root&gt;
  </code></pre>
  
  <p>I tried to look <a href="https://community.oracle.com/message/11219771#11219771" rel="nofollow">here</a> and <a href="https://community.oracle.com/message/9487631" rel="nofollow">here</a> on Oracle Forums but found no answer that I could use.</p>