split XML file into multiple files based on pattern

Hello, I am using awk to split a file into multiple files using command:
nawk '{
if ( $1 == "<process" )
{
n=split($2, arr, "\"");
file=arr[n-1]
}
print > file }' processes.xml

<process name="Process1.process">
<starter>ABC</starter>
</process>
....
....
<process name="Applications/Process2.process">
<starter>DEF</starter>
</process>

I am looking to create 2 files Process1.process and Process2.process, but I am getting error for Process2 as the name is "Applications/Process2.process"

awk: cmd. line:6: (FILENAME=../processes.xml FNR=4) fatal: can't redirect to `Applications/Process2.process' (No such file or directory)

How do I yank "Applications/" as part of the script.

Thanks..

Try something like this little sample:

awk '
    /<process name=/ {
        file = $0; 
        gsub( ".*=\"", "", file );   
        gsub( "\".*", "", file );
        gsub( ".*/", "", file );
        print file;
    }
' input-file

This assumes this is the last/only name="path/name" assignment on the input line.

perl -ne 'if(/<process name/../<\/process>/){
if(/<process name/){$f=(split /=/)[1];$f=~tr/">//d;$f=~s/.*\///g;}
open O, ">> $f";print O;close O}' processes.xml
$ ls -l Process*
-rw-r--r-- 1 root root 68 Jan 10 03:46 Process1.process
-rw-r--r-- 1 root root 81 Jan 10 03:46 Process2.process
$
$ cat Process1.process
<process name="Process1.process">
<starter>ABC</starter>
</process>
$
$ cat Process2.process
<process name="Applications/Process2.process">
<starter>DEF</starter>
</process>
$

Thanks a bunch! I tried both, but using piece of the command Agama suggested.