# How to right align content of pbox?

Lets have simple \pbox example like this:

\documentclass[twoside]{book}
\usepackage{pbox, calc}
\begin{document}
\noindent\fbox{\pbox{\textwidth}{Some text\\Text}}
\end{document}


Here is printed result:

I want that Text on second line to be alighned right. I tried to adjust previous code so that it reads:

\documentclass[twoside]{book}
\usepackage{pbox, calc}
\begin{document}
\noindent\fbox{\pbox{\textwidth}{\begin{flushright}Some text\\Text\end{flushright}}}
\end{document}


When trying to compile it I'm getting following error:

! LaTeX Error: Something's wrong--perhaps a missing \item.


Even with the error there is still some output but it is not entirely correct (too big box margins):

How can I correctly right align content of pbox?

-

\documentclass[twoside]{book}
\usepackage{pbox, calc}
\def\flushRight{\leftskip0pt plus 1fill\rightskip0pt}
\begin{document}
\noindent\fbox{\pbox{\textwidth}{\flushRight Some text\\Text}}
\end{document}


-

You can use \RaggedLeft from ragged2e package.

\documentclass[twoside]{book}
\usepackage{pbox,ragged2e}
\begin{document}
\noindent\fbox{\pbox{\textwidth}{\RaggedLeft Some text\\Text}}
\end{document}


-
Works in this simple example but does not when content of \pbox is more complex. –  drasto Mar 3 '13 at 2:40
@drasto Can you show a code where this is not working? –  Harish Kumar Mar 3 '13 at 6:15
I would like to but I'm afraid I cannot :( Licencing issues. I tried to isolate the cause and post some example but it is taking too much time - code that creates content of \pbox is rather complex. Anyway, solution from @JLDiaz answer works well. –  drasto Mar 4 '13 at 1:38