Script to copy valid posts from posts.xml to new file