title: Serialize Oracle row to XML
body: <p>I want to create a stored procedure that takes the name of a table and a row_id and can serialize it to an xml string.</p>
  
  <p>The table may contain clobs and blobs.</p>
  
  <p>Can I do this in PL/SQL, or do I have to use Java?</p>
  
  <p>The main objective for this is to have a table with all updates and deletes on some tables, keeping the X latest versions, or X days of Data (the table would include something like <code>chg_date(default:sysdate)</code>, <code>chg_type(U or D)</code>, <code>chg_xml</code>, and probably with some metadata about the user). </p>
  
  <p>Possible uses:
    - It could also keep all the data and be used as a log
    - The ability to return the row to any previous value.
    - The ability to do EDI in a specific format.</p>
  
  <p>I don't want to use Oracle's flashback queries to get there since there's no guarantee of the data availability. </p>