Validates whether a string matches the production for an XML name or qualified name