title: How to Insert data using cursor into new table having single column containing XML type data in Oracle?
body: <p>I'm able to insert values into table 2 from table 1 and execute the PL/SQL procedure successfully but somehow the output is clunky. I don't know why?</p>
  
  <p>Below is the code :</p>
  
  <pre><code> create table airports_2_xml
   (
      airport xmltype
   );
  
   declare
   cursor insert_xml_cr is select * from airports_1_orcl;
  
    begin
    for i in insert_xml_cr
    loop
        insert into airports_2_xml values
        (
             xmlelement("OneAirport",
             xmlelement("Rank", i.Rank) ||
             xmlelement("airport",i.airport) ||
             xmlelement("Location",i.Location) || 
             xmlelement("Country", i.Country) ||
             xmlelement("Code_iata",i.code_iata) || 
             xmlelement("Code_icao", i.code_icao) ||
             xmlelement("Total_Passenger",i.Total_Passenger) ||
             xmlelement("Rank_change", i.Rank_change) ||
             xmlelement("Percent_Change", i.Percent_change)
      ));
    end loop;
   end;
   /
  
  select * from airports_2_xml;   
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/DBI2q.png" alt="Result"></p>
  
  <p>Why it is showing &amp;lt ,&amp;gt in the output ? And why am I unable to see the output fully?</p>
  
  <blockquote>
    <p>Expected output:</p>
  </blockquote>
  
  <pre><code>      &lt;OneAirport&gt;
           &lt;Rank&gt;3&lt;/Rank&gt;
           &lt;Airport&gt;Dubai International&lt;/Airport&gt;
          &lt;Location&gt;Garhoud&lt;/Location&gt;
          &lt;Country&gt;United Arab Emirates&lt;/Country&gt;
          &lt;Code_IATA&gt;DXB&lt;/Code_IATA&gt;
         &lt;Code_ICAO&gt;OMDB&lt;/Code_ICAO&gt;
          &lt;Total_passenger&gt;88242099&lt;/Total_passenger&gt;
         &lt;Rank_change&gt;0&lt;/Rank_change&gt;
          &lt;Percent_Change&gt;5.5&lt;/Percent_Change&gt;
        &lt;/OneAirport&gt;
  </code></pre>