linux shell xml文件,在shell脚本中使用sed命令在XML文件中添加XML元素

我使用sed命令将xml元素插入到现有的xml文件中.

我有xml文件

john>

123

mike

234

我想添加新元素作为

NewName

NewID

所以我的新xml文件将是

john>

123

mike

234

NewName

NewID

为此,我编写了shell脚本

#! /bin/bash

CONTENT="

NewName

NewID

"

#sed -i.bak '// i \ "$CONTENT" /root/1.xml

sed -i.bak '// i \'$CONTENT'/' /root/1.xml

我收到错误了

sed: can't read NewName: No such file or directory

sed: can't read NewID: No such file or directory

sed: can't read : No such file or directory

并且在xml文件中,只有< student>被添加.

其余元素未添加.

有谁知道为什么这个错误?