title: How to get a self-closing xml tag in Oracle PLSQL?
body: <p>The Requested output is should be as follows:</p>
  
  <pre><code>&lt;Consignment id="123" date="2017-06-08"&gt;
      &lt;Box id="321" /&gt;
  &lt;/Consignment&gt;
  </code></pre>
  
  <p>where the <code>&lt;box&gt;</code> tag should be self-closing as above.</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>SELECT XMLELEMENT( "Consignment", XMLATTRIBUTES('123' AS "id",sysdate AS "date" ),
              XMLELEMENT( "Box", xmlattributes( '321' as "id" ))     
                   ).getstringval() as xxx FROM DUAL;
  </code></pre>
  
  <p>but it always return the following results (where the tag <code>&lt;box&gt;</code> has a separated closing tag <code>&lt;/box&gt;</code>):</p>
  
  <pre><code>&lt;Consignment id="123" date="2017-06-08"&gt;
      &lt;Box id="321"&gt;&lt;/Box&gt;
  &lt;/Consignment&gt;
  </code></pre>
  
  <p>how to get the above <code>&lt;box&gt;</code> tag self-closed?</p>