Help me to command to output file format.

Dear Master.

Help me to command to out put.

Ex log.

"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251032659</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>1111111</msisdn>
    <serviceid>1111111</serviceid>
  </destination>
  <originator>
    <mobi>123456724748274</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154543</timestamp>
    </header>
    <sms>
      <msg>M</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154543</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251032880</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>1111111</msisdn>
    <serviceid>1111111</serviceid>
  </destination>
  <originator>
    <mobi>123456704470545</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154545</timestamp>
    </header>
    <sms>
      <msg>M</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154545</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251034752</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>2222222</msisdn>
    <serviceid>2222222</serviceid>
  </destination>
  <originator>
    <mobi>123456744075149</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154457</timestamp>
    </header>
    <sms>
      <msg></msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154457</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251037535</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>3333333</msisdn>
    <serviceid>3333333</serviceid>
  </destination>
  <originator>
    <mobi>123456769969117</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154521</timestamp>
    </header>
    <sms>
      <msg>D</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154521</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251037655</txid>
  <authentication>
    <user>Amrdu</user>
    <password>1234Test</password>
  </authentication>
  <destination>
    <msisdn>4444444</msisdn>
    <serviceid>4444444</serviceid>
  </destination>
  <originator>
    <mobi>123456781540765</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154522</timestamp>
    </header>
    <sms>
      <msg>R</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154522</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251037848</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>3333333</msisdn>
    <serviceid>3333333</serviceid>
  </destination>
  <originator>
    <mobi>123456768454593</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154524</timestamp>
    </header>
    <sms>
      <msg>D</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154524</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251039455</txid>
  <authentication>
    <user>Amrdu</user>
    <password>1234Test</password>
  </authentication>
  <destination>
    <msisdn>4444444</msisdn>
    <serviceid>5555555</serviceid>
  </destination>
  <originator>
    <mobi>123456714329185</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154536</timestamp>
    </header>
    <sms>
      <msg>A</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154536</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251040120</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>1925532</msisdn>
    <serviceid>6666666</serviceid>
  </destination>
  <originator>
    <mobi>123456769505122</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154540</timestamp>
    </header>
    <sms>
      <msg>A</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154540</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251040593</txid>
  <authentication>
    <user>Amrdu</user>
    <password>1234Test</password>
  </authentication>
  <destination>
    <msisdn>4444444</msisdn>
    <serviceid>4444444</serviceid>
  </destination>
  <originator>
    <mobi>123456781540765</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154544</timestamp>
    </header>
    <sms>
      <msg>R</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154544</startCallDateTime>
</anova-test-bom>"
"<?xml version=""1.0"" encoding=""UTF-10"" ?><anova-test-bom>
  <txid>17251041433</txid>
  <authentication>
    <user>admin</user>
    <password>Amrduoi</password>
  </authentication>
  <destination>
    <msisdn>3333333</msisdn>
    <serviceid>3333333</serviceid>
  </destination>
  <originator>
    <mobi>1234567882795</msisdn>
  </originator>
  <message>
    <header>
      <timestamp>20100903154550</timestamp>
    </header>
    <sms>
      <msg>D</msg>
      <msgtype>E</msgtype>
      <encoding>0</encoding>
    </sms>
  </message>
  <startCallDateTime>20100903154550</startCallDateTime>
</anova-test-bom>"


I want out put format.

<msg>M</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>M</msg> <msgtype>E</msgtype> <encoding>0</encoding>
.
.
.
.
<msg>D</msg> <msgtype>E</msgtype> <encoding>0</encoding>

.

Help me please.
Thank YOU.

Try:

awk 's{s=s FS $1} /<msg>/{s=$1} /<encoding>/{print s; s=""}' file
# grep -A 1 msg infile | sed 'N;N;s/\(.*\)\n\(.*\)\n\(.*\)/\1\2\3/;n;' | sed '/.*msg.*/!d;s/  */ /g;s/^.//'
<msg>M</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>M</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg></msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>D</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>R</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>D</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>A</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>A</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>R</msg> <msgtype>E</msgtype> <encoding>0</encoding>
<msg>D</msg> <msgtype>E</msgtype> <encoding>0</encoding>