<?xml version="1.0" encoding="windows-1252"?>
<node id="962257" title="Re^2: manipulating alignment data" created="2012-03-28 17:05:41" updated="2012-03-28 17:05:41">
<type id="11">
note</type>
<author id="540414">
jwkrahn</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;c&gt;
for (split //, $template) {
    print ord == 0 ? '.' : 'X';
}
print "\n";
&lt;/c&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;
Another way to do that:
&lt;/p&gt;
&lt;c&gt;
$template =~ tr/\0/X/c;
$template =~ tr/\0/./;
print "$template\n";
&lt;/c&gt;
&lt;p&gt;
But this looks like it produces the output the OP wants:
&lt;/p&gt;
&lt;c&gt;
print "position $-[0] is not conserved\n" while $template =~ /[^\0]/g;
&lt;/c&gt;
</field>
<field name="root_node">
962149</field>
<field name="parent_node">
962162</field>
</data>
</node>
