title: If Attribute value is not empty in given xml, get the attribute value
body: <p>In the below XML I need attribute value (ID="5682094") if Type="CARMENT"  from IdealId element</p>
  
  <pre><code>&lt;ns0:doingRS xmlns:ns0="http://myorg.com" xmlns:ns2="http://commonOrg"&gt;
      &lt;ns2:Pass/&gt;
      &lt;ns0:something&gt;
          &lt;ns0:some abc="false" xyz="false" prq="track" str="RACK" fdg="true" fgdg="true" fdfd="false" ewe="false" ytyt="false" trtrt="false" ewew="false" fdfdf="false" bgn="false" ujm="false" qa="false" qws="false" qwe="false" wqwqwqw="false"&gt;
              &lt;ns2:SomeRates&gt;
                  &lt;ns2:SomeRate CodeH="track" someCode="RACK"&gt;
                      &lt;ns2:SomeProfile&gt;
                          &lt;ns2:SomeProfileList&gt;
                              &lt;ns2:IdealID Type="Prr" Ideal_CTX="ABC" ID="5033095"/&gt;
                              &lt;ns2:IdealID Type="CARMENT" Ideal_CTX="ABC" ID=""/&gt;
                          &lt;/ns2:SomeProfileList&gt;
                      &lt;/ns2:SomeProfile&gt;
                      &lt;ns2:SomeProfile&gt;
                          &lt;ns2:SomeProfileList&gt;
                              &lt;ns2:IdealID Type="Prr" Ideal_CTX="ABC" ID="5043839"/&gt;
                              &lt;ns2:IdealID Type="CARMENT" Ideal_CTX="ABC" ID=""/&gt;
                          &lt;/ns2:SomeProfileList&gt;
                      &lt;/ns2:SomeProfile&gt;
                      &lt;ns2:SomeProfile&gt;
                          &lt;ns2:SomeProfileList&gt;
                              &lt;ns2:IdealID Type="Prr" Ideal_CTX="ABC" ID="5682094"/&gt;
                              &lt;ns2:IdealID Type="CARMENT" Ideal_CTX="ABC" ID="5682094"/&gt;
                          &lt;/ns2:SomeProfileList&gt;
                      &lt;/ns2:SomeProfile&gt;
                  &lt;/ns2:SomeRate&gt;
              &lt;/ns2:SomeRates&gt;
          &lt;/ns0:some&gt;
      &lt;/ns0:something&gt;
  &lt;/ns0:doingRS&gt;
  </code></pre>
  
  <p>So in summary i need attribute value if and only if attribute is not empty.
  If there exists xpath/xquery to extract the attribute Id, please help me out </p>