public static bool ValidateXml (string xml) { try { XmlDocument xmlDoc = new XmlDocument (); xmlDoc.LoadXml (xml); return true; } catch (Exception) { return false; } }