I have a very big xml with no root node (oversimplified example):
<address>1</address>
<address>2</address>
<address>3</address>
<address>4</address>
I have tried to add the root node inside xmlstarlet to select and compute some data this way:
xmlstarlet -q fo -R file.xml | xmlstarlet sel -t -v "count(//address)"
seems to work but removing all but first node, so calculation is not working:
<?xml version="1.0"?>
<address>1</address>