title: remove ID attribute from XML in Unix
body: <p>I want to remove ID attribute from a XML file as below. Tries some sed command but it not yielding correct result. need help in correcting my sed command</p>
  
  <pre><code>&lt;State&gt;
  &lt;Resident Id="100"&gt;
  &lt;Name&gt;Sample Name&lt;/Name&gt;
      &lt;PhoneNumber&gt;1234567891&lt;/PhoneNumber&gt;
      &lt;EmailAddress&gt;sample_name@example.com&lt;/EmailAddress&gt;
      &lt;Address&gt;
          &lt;StreetLine1&gt;Street Line1&lt;/StreetLine1&gt;
          &lt;City&gt;City Name&lt;/City&gt;
          &lt;StateCode&gt;AE&lt;/StateCode&gt;
          &lt;PostalCode&gt;12345&lt;/PostalCode&gt;
      &lt;/Address&gt;
  &lt;/Resident&gt;
  &lt;Resident Id="101"&gt;
      &lt;Name&gt;Sample Name1&lt;/Name&gt;
      &lt;PhoneNumber&gt;1234567891&lt;/PhoneNumber&gt;
      &lt;EmailAddress&gt;sample_name1@example.com&lt;/EmailAddress&gt;
      &lt;Address&gt;
          &lt;StreetLine1&gt;Current Address&lt;/StreetLine1&gt;
          &lt;City&gt;Los Angeles&lt;/City&gt;
          &lt;StateCode&gt;CA&lt;/StateCode&gt;
          &lt;PostalCode&gt;56666&lt;/PostalCode&gt;
      &lt;/Address&gt;
  &lt;/Resident&gt;
  &lt;Resident Id="" /&gt;
  &lt;/State&gt;
  </code></pre>
  
  <p>Tried below sed commands but it not giving me correct result.</p>
  
  <pre><code>sed -i 's/^(ID=".*)".*/\1&gt;/' Resident.xml
  
  sed '/ ID.*/d' Resident.xml
  </code></pre>
  
  <p>Want xml like below. All id attributes removed from xml.</p>
  
  <pre><code>&lt;State&gt;
  &lt;Resident&gt;
  &lt;Name&gt;Sample Name&lt;/Name&gt;
      &lt;PhoneNumber&gt;1234567891&lt;/PhoneNumber&gt;
      &lt;EmailAddress&gt;sample_name@example.com&lt;/EmailAddress&gt;
      &lt;Address&gt;
          &lt;StreetLine1&gt;Street Line1&lt;/StreetLine1&gt;
          &lt;City&gt;City Name&lt;/City&gt;
          &lt;StateCode&gt;AE&lt;/StateCode&gt;
          &lt;PostalCode&gt;12345&lt;/PostalCode&gt;
      &lt;/Address&gt;
  &lt;/Resident&gt;
  &lt;Resident&gt;
      &lt;Name&gt;Sample Name1&lt;/Name&gt;
      &lt;PhoneNumber&gt;1234567891&lt;/PhoneNumber&gt;
      &lt;EmailAddress&gt;sample_name1@example.com&lt;/EmailAddress&gt;
      &lt;Address&gt;
          &lt;StreetLine1&gt;Current Address&lt;/StreetLine1&gt;
          &lt;City&gt;Los Angeles&lt;/City&gt;
          &lt;StateCode&gt;CA&lt;/StateCode&gt;
          &lt;PostalCode&gt;56666&lt;/PostalCode&gt;
      &lt;/Address&gt;
  &lt;/Resident&gt;
  &lt;Resident /&gt;
  &lt;/State&gt;
  </code></pre>