I got an XML template which looks like this (excerpt):
<isSomething>_xxx_</isSomething>
<someValue>_xxx_</someValue>
My code is going through the template and replacing the _xxx_ placeholders using XML::LibXML's findnode and setData methods respectively.
In the end it looks like this:
<isSomething>true</isSomething>
<someValue>123.45</someValue>
This does the job, however the recipient system would be more happy if the isSomething tag would look like this in case its true:
<isSomething/>
And would be completely omitted in case it's false. Is there a way to do that with XML::LibXML or should i apply the mighty regex power on the string output?