title: converting xml to json using postgresql
body: <p>I am working on converting XML to j son string using the PostgreSQL. 
  we have attributecentric XML and would like to know how to convert it to j son.</p>
  
  <p>Example XML: </p>
  
  <pre><code>&lt;ROOT&gt;&lt;INPUT id="1" name="xyz"/&gt;&lt;/ROOT&gt;
  </code></pre>
  
  <p>Need to get the j son as follows:</p>
  
  <pre><code>{ "ROOT": { "INPUT": {  "id": "1", "name": "xyz" }}}
  </code></pre>
  
  <p>got the above json format from an online tool.</p>
  
  <p>any help or guidance will be appreciated.</p>
  
  <p>Regards
  Abdul Azeem</p>