I looked at the XSLT idea that three people suggested. I even went to various XSLT websites. It seems to represent an extraordinary deviation from my requirement with no clear way back to it. Also, I just found XML::Traverse::ParseTree, which might well be the answer.