fixes LUX-71: NPE when inserting non-XML documents