title: How to move the XML output from Postgres Function to the left side?
body: <pre><code>&lt;AffinityDomains&gt;
    &lt;affinitytoken AFFINITYTOKEN="AP10000418"/&gt;
    &lt;affinitytoken AFFINITYTOKEN="AP10000021"/&gt;
    &lt;/AffinityDomains&gt;
  </code></pre>
  
  <p>Guys how can I move the last line in the xml output  aligned to the first line. I'm using CHR Functions and XML Element keywords to generate this XML and populate the output in Postgres table field XML_VALUE</p>
  
  <pre><code>BEGIN
  l_crlf     := CHR(13)||CHR(10);
  
  FOR i IN c1 LOOP
  
  select xmlelement(name AffinityToken,xmlattributes(
  i.Affinity_Token as "AFFINITYTOKEN",
  i.email_domain as "EMAILDOMAIN")) into v_gac;           
  
  mainXML := concat(mainxml, v_gac, l_crlf, CHR(9));  
  
  END LOOP;
  
  mainXML := concat(mainxml, '&lt;/AffinityDomains&gt;', l_crlf);   
  End;
  </code></pre>
  
  <p>Appreciate your time and please let me know for any further information,</p>