class Nokogiri::XML::DocumentFragment

def initialize document, tags = nil, ctx = nil

to +ctx+.
subtree created, e.g., namespaces will be resolved relative
If +ctx+ is present, it is used as a context node for the

Create a new DocumentFragment from +tags+.
#
def initialize document, tags = nil, ctx = nil
  return self unless tags
  children = if ctx
               # Fix for issue#490
               if Nokogiri.jruby?
                 # fix for issue #770
                 ctx.parse("<root #{namespace_declarations(ctx)}>#{tags}</root>").children
               else
                 ctx.parse(tags)
               end
             else
               XML::Document.parse("<root>#{tags}</root>") \
                 .xpath("/root/node()")
             end
  children.each { |child| child.parent = self }
end