add option to return a document fragment

add an option to return a document fragment instead of an array

for the tests, i just copied the current tests and adapted it

like #18 but maintains backwards compatibility and always returns a document fragment.

i can add docs if you merge this