I am upgrading from 5.3 M040 to 5.4 M100 and have noticed something odd.
In one of my FOSI stylesheets, I use the system-func attrule to call an ACL function and set a savetext as the return value. This function has resided in the instance.acl file of this particular doctype and has never given me trouble (I also use it to load doctype-specific menus with no issue).
Upgrading to 5.4, and loading a document that uses this FOSI, causes an error that the function used in the FOSI has not been defined. The custom menu was added. I moved the function to the custom\init and all was well again.