generalized adding a category in the slidein menu from Java to XML templates