Update documentation to describe the use of _document and explain why const_cast. Also removed some commented out code block.