Split hash keys
Write xml attributes given a prefix