I&#x27;m going a tiny step further with the XML&#x2F;HTML generation solution in functional Perl [1]: provide actual functions to instantiate HTML (or defined XML) elements, instead of relying on arrays. That allows for passing them directly to higher-order functions like map (and it also gives elements a proper type).<p><pre><code>  my $rows= list(list(1,2,3), list(4,5,6));
  HTML(BODY(TABLE($rows-&gt;map(fun($row) { TR($row-&gt;map(*TD)) }))))-&gt;string
  # =&gt; &#x27;&lt;html&gt;&lt;body&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;1&lt;&#x2F;td&gt;&lt;td&gt;2&lt;&#x2F;td&gt;&lt;td&gt;3&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;&lt;tr&gt;&lt;td&gt;4&lt;&#x2F;td&gt;&lt;td&gt;5&lt;&#x2F;td&gt;&lt;td&gt;6&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;table&gt;&lt;&#x2F;body&gt;&lt;&#x2F;html&gt;&#x27;

  ref HTML()
  # =&gt; &#x27;PXML::PXHTML&#x27;;
</code></pre>
[1] <a href="http:&#x2F;&#x2F;functional-perl.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;functional-perl.org&#x2F;</a>