let new_ tag attrs =
  let rec loop = function
      [] -> []
    | (name, value) :: xs -> sv_of_string name :: sv_of_string value :: loop xs
  in
  let sv = call_class_method "HTML::Element" "new"
             (sv_of_string tag :: loop attrs) in
  new html_element sv