Prevent Nokogiri::XML segfault by keeping XML Document around

Fixes issue #65