\documentclass{article}
\usepackage{bidi}
\usepackage{xltxtra}
\usepackage[novoc]{arabxetex}
\usepackage{fontspec}
\usepackage{color}
\usepackage{listings}

\lstset{ %
language=C++,                % choose the language of the code
basicstyle=\footnotesize,       % the size of the fonts that are used for the code
numbers=left,                   % where to put the line-numbers
numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers
stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered
numbersep=5pt,                  % how far the line-numbers are from the code
backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}
showspaces=false,               % show spaces adding particular underscores
showstringspaces=false,         % underline spaces within strings
showtabs=false,                 % show tabs within strings adding particular underscores
frame=single,                   % adds a frame around the code
tabsize=2,              % sets default tabsize to 2 spaces
captionpos=b,                   % sets the caption-position to bottom
breaklines=true,        % sets automatic line breaking
breakatwhitespace=false,    % sets if automatic breaks should only happen at whitespace
escapeinside={\%}{)}          % if you want to add a comment within your code
}

\newfontfamily{\arabicfont}[Script=Arabic,Scale=2]{Traditional Arabic}
\newcommand{\ar}[1]{\RL{\arabicfont#1}}
\title{Title here \textarab{عنوان البحث}}
\author{\textarab{اسم الكاتب}}
\date{\textarab{31/10/2009}}
\begin{document}
\renewcommand*\abstractname{\textarab{مقــــــدمة}}
\maketitle
\setRTL
\newpage

\begin{abstract}
\textarab{  مقدمة عن البحث وفائدته123}
\end{abstract}
\newpage

\tableofcontents
\newpage

\textarab{
السلام عليكم ورحمة الله وبركاته ،
}

\section{\textarab{الفصل الاول}}
\textarab{
الفصل الاول هو اول فصل في هذا البحث وسوف يتحدث عن المواضيع الاساسية ، مثل: } 
\LR{English words appear in reverse order ? Why.}


\LR{ English words appear in reverse order ? Why.}


\section{\textarab{الفصل الثاني}}
\textarab{
اما الفصل الثاني سيتحدث عن النقاط التالية:}

\begin{itemize}
\item \textarab{الموضوع الاول}
\item \textarab{الموضوع الثاني}
\item \textarab{الموضوع الثالث}
\begin{itemize}
\item \textarab{الفقرة الاولى}
\item \textarab{الفقرة الثانية}
\end{itemize}
\end{itemize}

\subsection{\textarab{الجزء الاول}}
\textarab{هذا الجزء برمجي ، وسيعرض أساسيات لغة ال} Cpp \textarab{حيث أنها لغة قوية وتعمل في العديد من المنصات بشرط وجود مترجم}

\setLTR
\begin{lstlisting}
#include <iostream>
using namespace std;

int main()
{
    cout << "Hello XeLaTex" << endl;
    return 0;
}

\end{lstlisting}

\setRTL
\subsection{\textarab{الجزء الثاني}}
{\textarab{عربي}}  \LR{English word}  \textarab{عربي}\\\\
{\tiny{\textarab{ تجربة}}}
{\scriptsize{\textarab{ تجربة}}}
{\footnotesize{\textarab{ تجربة}}}
{\small{\textarab{ تجربة}}}
{\normalsize{\textarab{ تجربة}}}
{\large{\textarab{ تجربة}}}
{\Large{\textarab{ تجربة}}}
{\LARGE{\textarab{ تجربة}}}
{\huge{\textarab{ تجربة}}}
{\Huge{\textarab{ تجربة}}}
{\fontsize{40pt}{40pt}{\textarab{ تجربة}}}
{\fontsize{100pt}{100pt}{\textarab{ تجربة}}}
\end{document}