Add length constraint to XQueryGenerator

Change-Id: If80ac394d4afeca7f21157821df4e1f9379608e2