Count all nodes in one or more XML documents

xml select

  • Select from XML documents using XPATHs.
    Tip: use `xml elements` to display the XPATHs of an XML document.
    More information: <http://xmlstar.sourceforge.net/docs.php>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

xml select --text --template --inp-name --output " " --value-of "count(node())" --nl {{path/to/input1.xml|URI}} {{path/to/input2.xml|URI}}

click the source code to copy install xml select on any operating system with command-not-found.com