XML category management

Fixes #1