xmlstarlet is too problematic; try xmllint instead