Ages ago, well... months ago, someone asked on Usenet for a small example that uses XML::Parser. I first gave a link to an example on my site: Finding the number of unique XML elements in files using XML::Parser but the author of the original post asked for a simple example showing how to remove processing instructions (PIs) and comments, so I posted a small working example, see Removing Processing Instructions and Comments from XML using XML::Parser