Is there a pipe-friendly program that takes:
- An XML document
- An XPath expression indicating the target element(s)
- The desired replacement
? Something like
sed but knowledgeable about XML (elements, whitespace, etc.)?
If you don't mind using/learning XSLT, there is the xsltproc utility which can accomplish this.
XMLSH has a command xed that might fit your parameters.