1. A computer program product comprising a computer readable storage medium having computer usable program code programmed to perform handling of a LET binding during an XML pivot join procedure, the computer program product having operations comprising: receiving an Xquery “FOR, LET, WHERE, ORDER BY, and RETURN” (“FLWOR”) expression for identifying at least one XML document that matches the XQuery FLWOR expression; identifying a LET binding of the XQuery FLWOR expression, wherein the LET binding comprises a context step in a WHERE clause within the XQuery FLWOR expression; identifying at least one logical expression within the WHERE clause, the at least one logical expression comprising next expression steps separated by logical operators; incorporating a replication of the LET binding with each next expression step within the WHERE clause to provide an XPath predicate; replicating a query tree of the XML pivot join procedure staffing with the LET binding and combining the query tree with a paths tree to form a match graph, the query tree comprising each replication of the LET binding, the match graph indicating each replication of the LET bindings within the query tree; and rewriting, based at least in part on the match graph, the XQuery FLWOR expression into an XPath query using the FOR binding of the XQuery FLWOR expression as a context step followed by the XPath predicate.