add ability to pass XML::LibXML::Document as param

Sorry for a noise, but I reinterpreted slightly :)
and I think this realization would be better then PR's #2 and #3

You can choose...