Need some help with parsing

I have a big xml file with little formatting in it. It contains over 600 messages that I need to break each message out in its own separate file.
The xml file looks in the middle of it something like this:

</Title></Msg><Msg><Opener> Hello how
are you?<Title> Some says hello</Title><Body>
This is a test to see how everything is
going. I need your help.</Body></Msg><Msg>
<Open1> An opening.</Open1><Title> Trying
something new.</Title><Report>124555ABC
</Report><Body> Another test for me.</Body>
<PS> I need to figure this out.</PS></Msg>
<Msg> etc........ etc... etc..
.......etc. .......

Some caveats:

  1. The messages always start with <Msg>
  2. The messages always ends with </Msg>
  3. The <Msg> could be at the beginning, middle or end of a line.
  4. The </Msg> could be at the beginning, middle or end of a line.
  5. There can be different amount of tag in a line i.e. <Title><Body>,etc...
  6. Message could be one to 100+ lines long.

Any suggestion on breaking each message from this xml file into its own file. Any sed/awk/nawk shell function/statements would be appreciated.
In the end, there is 600+ messages so there should be 600+ files.

Thank you.

Please read Simple rules of the UNIX.COM forums: before posting, especially 5 and 6.

Too old to be in school. Just working on a work project. Just need some help to get over this hurdle.

Sed/awk kind of sucks in breaking out one word in a line and breaking out file into multi files.

just one way without regexp. though, using regexp , you can set multiline pattern matching and non greediness.

awk 'BEGIN{ORS=""}{ s=s$0}
END {
 n=index(s,"<Msg>" )
 while ( n > 0 ) {   
   m=index(s,"</Msg>" )   
   str=substr(s, n+5,m)  
   printf "%s\n",str
   s=substr(s,length(str)+1 ) 
   n=index(s,"<Msg>")
 }
}
' file