sub escape { my ($s) = @_; for ($s) { die "\"$1\" can't be produced by aXML safely" if /([<>()\[\]])/; return $_; } }