You are indeed correct – it has been factored-out. Thank you for the clarification. Nevertheless, XSLT is there and well-supported to do exactly jobs like this, with or without(!) Perl being involved. Logic that attempts to do this "by hand" becomes extremely specific to the XML data structure that was originally parsed when it was originally written, and can be extremely difficult to accurately update when the XML definition changes. Fully-leveraging XML technologies via these standard binaries eliminates great code complexity and improves maintainability.