sig
  exception No_change
  type name = string * string
  module Name_ord : sig type t = name val compare : t -> t -> int end
  module Name_map :
    sig
      type key = name
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val max_binding : 'a t -> key * 'a
      val choose : 'a t -> key * 'a
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
    end
  module Name_set :
    sig
      type elt = name
      type t
      val empty : t
      val is_empty : t -> bool
      val mem : elt -> t -> bool
      val add : elt -> t -> t
      val singleton : elt -> t
      val remove : elt -> t -> t
      val union : t -> t -> t
      val inter : t -> t -> t
      val diff : t -> t -> t
      val compare : t -> t -> int
      val equal : t -> t -> bool
      val subset : t -> t -> bool
      val iter : (elt -> unit) -> t -> unit
      val fold : (elt -> '-> 'a) -> t -> '-> 'a
      val for_all : (elt -> bool) -> t -> bool
      val exists : (elt -> bool) -> t -> bool
      val filter : (elt -> bool) -> t -> t
      val partition : (elt -> bool) -> t -> t * t
      val cardinal : t -> int
      val elements : t -> elt list
      val min_elt : t -> elt
      val max_elt : t -> elt
      val choose : t -> elt
      val split : elt -> t -> t * bool * t
      val find : elt -> t -> elt
    end
  type 'a env
  and 'a callback =
      '->
      'Xtmpl.env ->
      Xtmpl.attributes -> Xtmpl.tree list -> 'a * Xtmpl.tree list
  and tree =
      E of Xtmpl.name * Xtmpl.attributes * Xtmpl.tree list
    | D of string
  and attributes = Xtmpl.tree list Xtmpl.Name_map.t
  val merge_cdata : Xtmpl.tree -> Xtmpl.tree
  val merge_cdata_list : Xtmpl.tree list -> Xtmpl.tree list
  type rewrite_stack = (Xtmpl.name * Xtmpl.attributes * Xtmpl.tree list) list
  exception Loop of Xtmpl.rewrite_stack
  val string_of_stack : Xtmpl.rewrite_stack -> string
  val atts_empty : Xtmpl.attributes
  val atts_of_list :
    ?atts:Xtmpl.attributes ->
    (Xtmpl.name * Xtmpl.tree list) list -> Xtmpl.attributes
  val atts_one :
    ?atts:Xtmpl.attributes ->
    Xtmpl.name -> Xtmpl.tree list -> Xtmpl.attributes
  val atts_remove : Xtmpl.name -> Xtmpl.attributes -> Xtmpl.attributes
  val atts_replace :
    Xtmpl.name -> Xtmpl.tree list -> Xtmpl.attributes -> Xtmpl.attributes
  val get_arg : Xtmpl.attributes -> Xtmpl.name -> Xtmpl.tree list option
  val get_arg_cdata : Xtmpl.attributes -> Xtmpl.name -> string option
  val opt_arg :
    Xtmpl.attributes -> ?def:Xtmpl.tree list -> Xtmpl.name -> Xtmpl.tree list
  val opt_arg_cdata : Xtmpl.attributes -> ?def:string -> Xtmpl.name -> string
  val string_of_args : Xtmpl.attributes -> string
  val env_empty : unit -> 'Xtmpl.env
  val env_add :
    ?prefix:string ->
    string -> 'Xtmpl.callback -> 'Xtmpl.env -> 'Xtmpl.env
  val env_get : Xtmpl.name -> 'Xtmpl.env -> 'Xtmpl.callback option
  val string_of_env : 'Xtmpl.env -> string
  val env_add_att :
    ?prefix:string ->
    string -> Xtmpl.tree list -> 'Xtmpl.env -> 'Xtmpl.env
  val env_of_list :
    ?env:'Xtmpl.env ->
    (Xtmpl.name * 'Xtmpl.callback) list -> 'Xtmpl.env
  val tag_main : string
  val tag_env : string
  val att_defer : string
  val att_escamp : string
  val att_protect : string
  val string_of_xml : Xtmpl.tree -> string
  val string_of_xmls : Xtmpl.tree list -> string
  val string_of_xml_atts : Xtmpl.attributes -> (Xtmpl.name * string) list
  val xml_of_string : ?add_main:bool -> string -> Xtmpl.tree
  val xmls_of_atts : (Xtmpl.name * string) list -> Xtmpl.attributes
  val xml_of_file : string -> Xtmpl.tree
  val apply_to_string : '-> 'Xtmpl.env -> string -> 'a * Xtmpl.tree list
  val apply_to_file : '-> 'Xtmpl.env -> string -> 'a * Xtmpl.tree list
  val apply_to_xmls :
    '-> 'Xtmpl.env -> Xtmpl.tree list -> 'a * Xtmpl.tree list
  val apply_into_file :
    '->
    ?head:string -> 'Xtmpl.env -> infile:string -> outfile:string -> 'a
  val apply_string_into_file :
    '-> ?head:string -> 'Xtmpl.env -> outfile:string -> string -> 'a
end