Finally I've found the problem. I used default namespace (not to be confused with no namespace), and I forgot that xpath expressions (that is in unique element) ignore default namespace. In other words default namespace elements can't be reached by xpath expression.
I added the prefix to namespace in XML and also to xpath expression in unique element, and now it works fine!