just make it 
```ruby
instruct ? @document.to_s : @document.root.to_s
```