How to Append the specific data to the xml file

I have an xml file data as shown below:

<impl name="Nortel" is-enabled="true">
<package-mappings>
<const-mapping target-state="EndPoint"
target-param="cfCNDSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCWSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCFVSubscribed" constant-value="true"/>
</package-mappings>

I want to append few line to the last that is after </package-mappings>

i am using the following script
but it seems to be not working

cat File.xml|sed '/\(.<impl name=\"Nortel\" *is-enabled=\"true\".\)/{
N
s:\(.<impl name=\"Nortel\" *is-enabled=\"true\".\)\n\( *\)<\/impl>.*$:\1\
\2<attribute max-instances="1" min-instances="0">\
\2 <simple-attribute name="securityLevel" type="number"\
\2is-key-field="false" is-package-defined="false">\
\2</attribute>:
}'

Please some one can help me out in the above issue.

Thank you very much in advance

data='<impl> .... </impl>
<attribute max-instances="1" min-instances="0">
<simple-attribute name="securityLevel" 
  type="number" is-key-field="false" is-package-defined="false">
</simple-attribute>'

printf "%s\n" "$data" >> File.xml

Actually my problem is, i have a data like below
<impl name="Nortel" is-enabled="true">
<package-mappings>
<const-mapping target-state="EndPoint"
target-param="cfCNDSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCWSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCFVSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCFBLSubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
target-param="cfCFDASubscribed" constant-value="true"/>
<const-mapping target-state="EndPoint"
</package-mappings>
<attribute max-instances="1" min-instances="0">
<simple-attribute name="lineNumber" type="string"
sub-type="number" is-key-field="false" is-package-defined="false">
<description>Telephone Number.</description>
<help>Subscriber's Telephone Number. </help>
</simple-attribute>
</attribute>

<attribute ....
</attribute>

</impl>

i want to the below data after </package-mappings> and above <attribute tag

below is the regular expression i am using to add but it is adding above
<package-mappings> but i have to add after </package-mappings>

The script i am using is
cat $i|sed '/\(.<impl name=\"NueraWithNortel\" *is-enabled=\"true\".\)/{
N
s:\(.<impl name=\"NueraWithNortel\" *is-enabled=\"true\".\)\n\( *\)<package-mappings>.*$:\1\
\2<attribute max-instances="1" min-instances="0">\
\2 <simple-attribute name="securityLevel" type="number"\
\2 is-key-field="false" is-package-defined="false">\
\2 <description>securityLevel</description>\
\2 <help>security level of the end pont</help>\
\2 </simple-attribute>\
\2</attribute>\
\2<package-mappings>:
}'
Please help me in resolving the issue
thank you very much in advance.