You can call Max directly on Descendants.
var result = xml1.Descendants("WbDrillPermitNo").Max(n => int.Parse(n.Value));