Fix unsafe cast of an xmlDocPtr into a xmlNodePtr.

On 64-bit systems this can lead to bad access memory crashes when an attempt is made to dereference a struct member which xmlDocPtr and xmlNodePtr don't hold in common.