my $data = < Some value another value EOF use IO::Scalar; my $SH = new IO::Scalar \$data; my $template = $xs->XMLin( $SH );