Am trying to split a big xml file into multiple files, and have used the following code in AWK script.
// {
rfile=\"fileItem\" count
If your XML is really that well formed and consistent then all you need is:
awk -F'[<>]' '
// { header="" ORS $0; next }
/ { close(out); out="item_" $3; $0=header ORS $0 }
{ print > out }
' file
The above is untested of course since you didn't provide sample input/output for us to test a possible solution against.