Fix: plugin: remove memory leak in legacy code

The xml data structure is created, but not free'd, causing a pretty severe memory leak.