title: How to replace value of xml attributes matching a regex in bash?
body: <p>I would like to substitute the values of XML attributes matching a regex in a file in bash.</p>
  
  <pre><code> &lt;Resource name="MailSession" auth="Container" type="javax.mail.Session"
              mail.smtp.host="localhost" mail.smtp.user="foo" mail.smtp.passwd="12345678"
              mail.pop3.host="localhost" mail.pop3.user="foo" mail.pop3.passwd="12345678"/&gt;
  </code></pre>
  
  <p>should be transformed to</p>
  
  <pre><code> &lt;Resource name="MailSession" auth="Container" type="javax.mail.Session"
              mail.smtp.host="***" mail.smtp.user="foo" mail.smtp.passwd="***"
              mail.pop3.host="***" mail.pop3.user="foo" mail.pop3.passwd="***"/&gt;
  </code></pre>
  
  <p>This should be possible using sed or awk.</p>