Stick with
XML::LibXML , while it may be easy to say
Don't do that witht CDATA and embedded markup, I believe it's impractical. I have many stylesheets and XML pages that dynamically generate HTML including javascript sections based upon the XML nodes. Even if you have control over how the XML files are created, it may not be prudent to remove all embedded tags. It is in that regard that the ability to include embedded tags in CDATA Sections was created/allowed (in my opinion anyway).
Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!