sed xml file multiple line replacement

I have a file called config.xml, it's a simple xml file, and I need use sed/awk to erase some lines.

  <machine xsi:type="unix-machineType">
    <name>server1</name>
    <node-manager>
      <name>server1</name>
      <listen-address>server1</listen-address>
    </node-manager>
  </machine>
  <machine xsi:type="unix-machineType">
    <name>server2</name>
  </machine>

That occurrs in the config.xml file, and I need to delete only the first occurrence, this part needs to be deleted:

  <machine xsi:type="unix-machineType">
    <name>server1</name>
    <node-manager>
      <name>server1</name>
      <listen-address>server1</listen-address>
    </node-manager>
  </machine>

so I'm only left with

  <machine xsi:type="unix-machineType">
    <name>server2</name>
  </machine>

----edit----

grep -A6 -m1 '<machine xsi*' config.xml

That gets me the exact result I want to remove

Try this:

awk 'BEGIN{f=1}
/<machine xsi:type="unix-machineType">/{f--}
!f && /<\/machine>/{f--;next}
f' file

Regards

Works perfect. There any way that can be done w/o piping it to another file, and just perform the command on the existing file? The script I'm going to add this to already backs it up so no need to name it to a tmp tile and then rename it again.

yes and no - a 'poor man' edit file in 'situ':

{ rm FILE; awk'...' > FILE; } < FILE