xmlstarlet

Command-line XML parsing, transformation, and editing tool.

brewmacoslinux
Try with needOr install directly
Source

About

XML command-line utilities

Commands

xml

Examples

pretty print XML to make it readable$ xml fo -o indent=space input.xml
extract specific values from XML file$ xml sel -t -v '//element/@attribute' input.xml
edit XML and change element values$ xml ed -u '//element' -v 'new_value' input.xml
convert XML to different format$ xml tr transform.xsl input.xml
validate XML against schema$ xml val -e input.xml