{ my %rep = qw{ " " ' ' } ; sub quote_xpath { my( $t ) = @_; $t =~ s/(['"])/ $rep{$1} /ge; return $t; } }