Fix dict2xml so it doesn't return an empty element for a empty dict.

- Perform type check on dict2xml parameter.