FIX: XML writer document ending

Fixed a bug where the XML writer would end the document with an opening
<posts> tag in place of a closing </posts> tag.