title: Create xml file using shell script
body: <p>I'm trying to create a xml file using shell script with the below source code.</p>
  
  <pre><code>#!/bin/sh
  header=`&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;menu_details&gt;`
  
  fmt=`   &lt;menu name="%menuName"&gt;
                  &lt;group name="%grpName" type="%M"&gt;
                          &lt;page-details&gt;
                                  &lt;page&gt;
                                          &lt;page-name&gt;%pageName&lt;/page-name&gt;
                                  &lt;/page&gt;
                          &lt;/page-details&gt;
                  &lt;/group&gt;
          &lt;/menu&gt;
  `
  footer=`&lt;/menu_details&gt;`
  
  {
  printf "%s\n" "$header"
  while read menuName grpName M pageName
  do
          printf "$fmt" "$menuName" "$grpName" "$M" "$pageName"
  done &lt; "dd.lst"
  printf "%s\n" "$footer"
  } &gt; dd.xml
  </code></pre>
  
  <p>Is it the proper way ?</p>