Supposing I have an HTML document like what's below:
mypage.html
<html xmlns="http://www.w3.org/1999/xhtml">
  <body>
    <table>
      <tbody>
       ...
       <tr>
         <td id="MY_ID">123</td>
How would I edit the element set to MY_ID? I've used the following command successfully when it was just the table in a document, but placing it in a larger document broke it:
xmlstarlet ed --update '//td[@id="MY_ID"]' --value '456' mypage.html
 
    