Fix null table

In compositing fresh XML this was failing. Extra checking for NULL to avoid complete failure I think is a good thing.