This error is caused if you include an ampersand directly in your query string. If you build queries in ADSIEdit they might look like:
(&(objectCategory=user)(sAMAccountName=Jane))
The “&” character is not allowed in XML. Instead use “&”
For example:
<Directives WhereToBind="LDAP://DC2008R2/CN=Users,DC=test,DC=com" SearchScope="onelevel" Filter="(&(objectCategory=user)(sAMAccountName=Jane))" PropertiesToReturn="distinguishedName"/>