(1) XML is hideous and ugly, and far more cluttered than any Lua.
(2) Is your "BName_initialize" function already loaded when your XML loads? If not (eg. if you are loading the XML file first, and then the Lua file where the function is defined) then that is your problem.