title: Displaying Data from databse in XML format in JSF
body: <p>I am working on a Java web application with Spring Hibernate ORM +JSF2.0 .I need to get data from database(MySQL) and display it in XML format (with nodes and sub-nodes) on a JSF page.</p>
  
  <p>In Managed Bean, I am returning the data in an arraylist 'al'. In JSF i want to iterate this list and dispaly data in XML tags as shown below.Please suggest me how to show it on JSF/.xhtml page.</p>
  
  <pre><code>    public ArrayList&lt;BusServiceBean&gt; listBus()
      {
         BusServiceBean buservs=new BusServiceBean();
         BusService bus=(BusService)ServiceFinder.findBean("busDaoTarget");
         ArrayList&lt;BusServiceBean&gt; al= bus.listBus(buservs);
         return al;   
       }
  </code></pre>
  
  <p>Example given below,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; 
  -&lt;markers&gt;
   -&lt;marker&gt;
   &lt;BUSNAME&gt;202ST1&lt;/BUSNAME&gt; 
   &lt;OWNER&gt;Tata Power&lt;/OWNER&gt; 
   &lt;AREA&gt;South&lt;/AREA&gt; 
   &lt;KVLEVEL&gt;400&lt;/KVLEVEL&gt; 
   &lt;STATUS&gt;In Service&lt;/STATUS&gt; 
   &lt;LATITUDE&gt;17.30868788677&lt;/LATITUDE&gt; 
   &lt;LONGITUDE&gt;78.7060546875&lt;/LONGITUDE&gt; 
  &lt;/marker&gt;
  -&lt;marker&gt;
    &lt;BUSNAME&gt;302ST2&lt;/BUSNAME&gt; 
    &lt;OWNER&gt;NTPC&lt;/OWNER&gt; 
    &lt;AREA&gt;Western India&lt;/AREA&gt; 
    &lt;KVLEVEL&gt;400&lt;/KVLEVEL&gt; 
    &lt;STATUS&gt;In Service&lt;/STATUS&gt; 
    &lt;LATITUDE&gt;23.7652368897587&lt;/LATITUDE&gt; 
    &lt;LONGITUDE&gt;71.630859375&lt;/LONGITUDE&gt; 
   &lt;/marker&gt;
  &lt;/markers&gt;
  </code></pre>