title: LibXML - Inserting a Comment
body: <p>I'm using XML::LibXML, I'd like to add a comment such that the the comment is outside the tag. Is it even possible to put it outside the tag?  I've tried appendChild, insertBefore | After, no difference ...</p>
  
  <pre><code>     &lt;JJ&gt;junk&lt;/JJ&gt; &lt;!--My comment Here!--&gt;
  
       # Code excerpt from within a foreach loop:
       my $elem     = $dom-&gt;createElement("JJ");
       my $txt_node = $dom-&gt;createTextNode("junk");
       my $cmt      = $dom-&gt;createComment("My comment Here!");
  
       $elem-&gt;appendChild($txt_node);
       $b-&gt;appendChild($elem);
       $b-&gt;appendChild($frag);
       $elem-&gt;appendChild($cmt);
  
      # but it puts the comment between the tags ...
      &lt;JJ&gt;junk&lt;!--My comment Here!--&gt;&lt;/JJ&gt;
  </code></pre>