Maybe this can help. But I didn't test it. Could you provide some sample XML?
<xsl:value-of select="/input/as/a[@id=$id]/*[translate(local-name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='camel' and @id2=$id2]/@interest"/>
EDIT
If you want to change your whole XML file to lower case (without elements and attributes values of course) you can use this following template:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz')}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Having done the conversion to lower-case, you can try to create multi-pass XSLT traformation - the next pass would be your conversion. However, I'm not sure how to do it using XSLT 1.0.
EDIT 2
OK, so here comes the whole example. I didn't have your examples so I worked on my own ones.
Sample input file:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<baba>aaa</baba>
<Baba>BBB</Baba>
</Root>
XSLT with multi-pass sorting:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="firstPassResult">
<xsl:apply-templates select="/" mode="firstPass"/>
</xsl:variable>
<xsl:template match="@*|node()" mode="firstPass">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*" mode="firstPass">
<xsl:element name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz')}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="$firstPassResult" mode="secondPass"/>
</xsl:template>
<xsl:template match="//baba" mode="secondPass">
<xsl:value-of select="text()"/>
</xsl:template>
</xsl:stylesheet>
I works under Altova XMLSpy debugger. Output:
<?xml version="1.0" encoding="UTF-8"?>aaaBBB