title: How do I produce XML with Perl's XML::Simple?
body: <p>I am just trying to create the XML </p>
  
  <pre><code>use XML::Simple;
  
  my %element = ( "a" =&gt; "10" , 
                  "b" =&gt; "20" ,);
  
  my $xs = new XML::Simple();
  my $ref = $xs-&gt;XMLin(%element);
  my $xml = $xs-&gt;XMLout($ref);
  print $xml;
  </code></pre>
  
  <p>What is wrong on this code ?  ( This is got Resolved ) </p>
  
  <pre><code>use XML::Simple;
  
  my %element = ( "a" =&gt; "10" , 
                  "b" =&gt; "20" ,);
  
  my $xs = new XML::Simple();
  my $xml = $xs-&gt;XMLout(\%element);
  print $xml;
  </code></pre>
  
  <p>This produces the following output:</p>
  
  <pre><code>&lt;opt a="10" b="20" /&gt;
  </code></pre>
  
  <p>But what I'd really like to get is this:</p>
  
  <pre><code>&lt;a&gt; 10 &lt;/a&gt;
  &lt;b&gt; 20 &lt;/b&gt;
  </code></pre>
  
  <p>How can I achieve this?</p>