This is a clunky workaround, and ideally you should specify your DTD a lot closer if you have any control over it. In one case we had though, we were receiving crappy data from a client where the case of a value could not be predicted.Here is a way to match case-insensitively using XPath’s translate method$xml->xpath('//example[translate(@name, \\'ABCDEFGHIJKLMNOPQRSTUVWXYZ\\',
\\'abcdefghijklmnopqrstuvwxyz\\') = \\'strtolower($name)\\']/.');
So, the value of the attribute ‘name’ in the ‘example’ node is parsed for any uppercase letters and they are replaced with lowercase letters. The match is then carried out as usual against a lower-cased $name.