fix XML format so it has a single encompassing element (<document>)