more munging to make valid XML