Resolve incorrect lexicographical comparisons of XML string values by explicitly casting them to numeric types before evaluation.