class Nokogiri::XML::Node

def add_first_child(content)

def add_first_child(content)
  if children.empty?
    add_child(content)
  else
    children.first.previous = content
  end
  self
end