xml-edit
Edit an XML document. tldr-pages
On several platforms
Several platforms
Delete elements matching an XPATH from an XML document
xml [ed --delete "XPATH1" path/to/input.xmlIdentifyMove an element node of an XML document from XPATH1 to XPATH2
xml [ed --move "XPATH1" "XPATH2" path/to/input.xmlIdentifyRename all attributes named "id" to "ID"
xml [ed --rename "//*/@id" -v "ID" path/to/input.xmlIdentifyRename sub-elements of the element "table" that are named "rec" to "record"
xml [ed --rename "/xml/table/rec" -v "record" path/to/input.xmlIdentifyUpdate the XML table record with "id=3" to the value "id=5"
xml [ed --update "xml/table/rec[@id=3]/@id" --value 5 path/to/input.xmlIdentifyDisplay help
xml [ed --helpIdentify