public static string VerifyNCName(string ncname) { if (ncname == null || ncname.Length == 0) { throw new ArgumentNullException("ncname"); } if (!XmlChar.IsNCName(ncname)) { throw new XmlException("'" + ncname + "' is not a valid XML NCName"); } return(ncname); }