How do I add child elements to XML using Perl's XML::Twig?

Posted by Ninja on Stack Overflow See other posts from Stack Overflow or by Ninja
Published on 2009-08-11T11:07:47Z Indexed on 2010/03/20 7:31 UTC
Read the original article Hit count: 586

Filed under:
|
|

I have the following XML file:

<SOURCE_SERVER>
  <SERVER HOSTNAME="serv1">
      <CIFS_SERVICE NETBIOSNAME="serv1"/>
  </SERVER>
  <SERVER HOSTNAME="serv2">
  </SERVER>
<SOURCE_SERVER>

Now, I want to add child <CIFS_SERVICE NETBIOSNAME="serv2"/> to <SERVER HOSTNAME="serv2">. How do I do this using XML::Twig?

© Stack Overflow or respective owner

Related posts about perl

Related posts about Xml