\documentclass{article}
\usepackage{bidi}
\usepackage{ucharclasses}
\usepackage{fontspec}
\setTransitionsForLatin{\fontspec[Mapping=tex-text]{Linux Libertine}}{}
\setTransitionsForArabic{\fontspec[Script=Arabic]{XB Zar}\beginR}{\endR}
\begin{document}
این یک آزمایش است.

This is just a test as you can see. 123
\end{document}