packages.xml is restored after reboot
sharedUserId is simply a copy of the parameter of the same name from the Android Manifest file. When you clear the dalvik cache and reboot, the sharedUserId attribute is read from the original apk files and packages.xml is rewritten. You'll probably need to disassemble the apk, edit the manifest, and reassemble the apk using a tool like apktool. Note that the new apk you create will not be signed, so it will not be automatically updated though the Play Store.