In a particular scenario,we faced a problem with CAML query, returning an error “The property Query contains an invalid value.”.

Our CAML query was:

<Contains><FieldRef Name=’Kits’/><Value Type=’Text’>Ray & Martin</Value></Contains>;

After lots of tries we came to the solution that only in value’s containing ‘&’ we faced the problem, for other cases it worked fine.

We tried using CDATA, and it worked.

The reason being,a CDATA section is a section of element content that is marked for the parser to interpret as only character data, not markup.

So, our new approach as:

<FieldRef Name=’Kits’/>     
<Value Type=’Text’>  <![CDATA[Ray & Martin]]></Value></Contains>