keep only white-listed elements and/or attributes
问题 I have an XML file with a plethora of nodes, each having a vast amount of attributes. For simplicity, let us assume the XML looking like this: <?xml version="1.0" encoding="UTF-8"?> <root> <header /> <group> <node1 attr1="x" attr2="y" attr3="z" /> <node2 attr4="x" attr5="y" attr6="z" /> <node3 attr7="x" attr8="y" attr9="z" /> <node1 attr1="x" attr2="y" attr3="z" /> </group> </root> I would like to reduce this XML into a smaller version by reducing the content of /root/group/ by eliminating