Use a proper xmltool, in shell, xmlstarlet is a good one :
xmlstarlet edit -L -u "//Model500[1]" -v "AAA
BBB
CCC" file.xml
xmlstarlet edit -L -u "//Model500[2]" -v "111
333
555" file.xml
cat file.xml
The expression //Model500[2]
is a Xpath expression
NOTE ¹
you need to enclose your xml with a tag like :
<root>
...
</root>
to be XML valid. I hope you cutted the XML file for the purpose of your question.
NOTE ²
You can also use python, perl, ruby etc... and a proper xml lib.
In perl :
#!/usr/bin/perl
use strict;
use warnings;
use XML::Simple;
my $xml_file = 'file.xml';
my $xml = XMLin(
$xml_file,
KeepRoot => 1,
ForceArray => 1,
);
$xml->{root}->[0]->{Model500}->[0] = "AAA\nBBB\nCCC\n";
$xml->{root}->[0]->{Model500}->[1] = "111\n222\n333\n";
XMLout(
$xml,
KeepRoot => 1,
NoAttr => 1,
OutputFile => $xml_file,
);