I am using sed command to insert an xml element into the existing xml file.
I have xml file as
This might work for you (GNU sed & Bash):
CONTENT=' \ NewName\ NewID\ ' sed '/<\/Students>/i\'"$CONTENT" file
Alternatively, put the new students in a file and:
sed '/<\/Students>/e cat new_student_file' file