Bidirectional typesetting in plain TeX and LaTeX, using XeTeX engine