Set document.root in parse function instead of create_document function