class Hpricot::Elem

def pretty_print(q)

def pretty_print(q)
  if empty?
    q.group(1, '{emptyelem', '}') {
      q.breakable; pretty_print_stag q
    }
  else
    q.group(1, "{elem", "}") {
      q.breakable; pretty_print_stag q
      if children
        children.each {|elt| q.breakable; q.pp elt }
      end
      if etag
        q.breakable; q.text etag
      end
    }
  end
end