# File lib/nokogiri/xml/document_fragment.rb, line 10 def initialize document, tags = nil, ctx = nil return self unless tags children = if ctx ctx.parse(tags.strip) else XML::Document.parse("<root>#{tags.strip}</root>") \ .xpath("/root/node()") end children.each { |child| child.parent = self } end