For case insensitive operation with Sitecore XPath Query, use CompareCaseInsensitive function.
For example:
/sitecore/content//*[CompareCaseInsensitive(@@keyname,'valueincasesensitive')]
And all XPath Query function defined in Sitcore.Data.Query.Functions
For example:
/sitecore/content//*[CompareCaseInsensitive(@@keyname,'valueincasesensitive')]
And all XPath Query function defined in Sitcore.Data.Query.Functions