example of how doc object is constructed as docs are parsed