If the input is XML, then it is best to use an XML-specific tool.
Method 1
One method for including a /
in a sed regex is to escape it with a backslash:
$ sed -ne '/<Model500>/,/<\/Model500>/p' file.txt
<Model500>
ABC
BCD
CDE
</Model500>
<Model500>
123
234
345
</Model500>
The expression /<Model500>/,/<\/Model500>/
specifies a range of lines. The range starts with a line that matches <Model500>
and ends with a line that matches <\/Model500>
. Since we are specifying a range, not a substitute command, the expression does not start with s
.
Method 2
If you don't want to escape it, you can use a different delimiter:
$ sed -ne '\|<Model500>|,\|</Model500>|p' file.txt
<Model500>
ABC
BCD
CDE
</Model500>
<Model500>
123
234
345
</Model500>
Here, we used |
as the delimiter. To signal that a delimiter other than /
is being used in a range, the first one should be escaped: \|
.