+external register_tag : tree -> string -> Tag.t = "caml_xml_tree_register_tag"
+
+external tag_name : tree -> Tag.t -> string = "caml_xml_tree_get_tag_name"
+
+let tag t = (); fun s ->
+ match s with
+ | "<$>" -> Tag.pcdata
+ | "<@>" -> Tag.attribute
+ | "" -> Tag.document_node
+ | "<@$>" -> Tag.attribute_data
+ | _ -> register_tag t s
+
+let to_string d = ();
+ fun t ->
+ if t == Tag.pcdata then "<$>"
+ else if t == Tag.attribute_data then "<@$>"
+ else if t == Tag.attribute then "<@>"
+ else if t == Tag.nullt then "<!NIL!>"
+ else tag_name d t
+
+let translate x = x
+
+let mk_tag_ops t = {
+ Tag.tag = tag t;
+ Tag.to_string = to_string t;
+ Tag.translate = translate
+}
+