You might want to have a look at XML::Descent. It's a stream parser so it's (relatively) light on memory usage, and it makes it easy to decide what to keep and what to ignore. It's not quite as simple as listing the elements you want, but it can get pretty darn close to that depending upon how you employ the module.

In reply to Re: Easily XML filtering? by gloryhack
in thread Easily XML filtering? by mattr

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":