added check for legal xml attribute names

As of right now, it doesn't try to fix the name or make it legal, it just includes illegal variable names as a line of log text instead of as an attribute.  I can do something more sophisticated later if we decide we need it.