Validate XML tags in converting JSON to XML

The current conversion to XML allow tag names that inject arbitrary XML (although there may be no way to make the resulting XML valid), because it does not ensure that a tag name is a valid XML tag (e.g. does not contain `>`). This should patch it to throw an error when tag name is invalid.