DRYd up a helper, removed unneeded xml support