X="MyJVM"
sed -n "/serverName=\"${X}\"/,/<\/serverEntries>/{/BOOTSTRAP_ADDRESS/{n;s/.*port=\"\([^\"]*\)\".*/\1/;p;};}" serverindex.xml
sed: 0602-413 There are too many '{'.
sed -n "/serverName=\"${X}\"/,/<\/serverEntries>/{ /BOOTSTRAP_ADDRESS/{n;s/.*port=\"\([^\"]*\)\".*/\1/;p;} }" serverindex.xml
sed -n "/serverName=\"${X}\"/,/<\/serverEntries>/{/BOOTSTRAP_ADDRESS/{n;s/.*port=\"\([^\"]*\)\".*/\1/;p;};}" serverindex.xml sed -n "/serverName=\"${X}\"/,/<\/serverEntries>/{ /BOOTSTRAP_ADDRESS/{n;s/.*port=\"\([^\"]*\)\".*/\1/;p;} }" serverindex.xml