xmlstarlet

XML command-line utilities for querying, editing, and transforming XML

brewmacoslinux
Try with needOr install directly
Source

About

XML command-line utilities

Commands

xml

Examples

Extract text from an XML element using XPath$ xml sel -t -v '//title' document.xml
Edit XML by updating an attribute value$ xml ed -u '//book[@id="1"]/@author' -v 'New Author' input.xml
Validate XML against a schema$ xml val -e schema.xsd document.xml