You can use xetex input mapping feature. It is used to typeset transliterated devanagari. Other example is RomDev, for input in unicode transliteration. I haven't find any map file for conversion in the opposite direction, but it was not difficult to modify the RomDev map to go in the other way.
Download the file DevRom.map and compile it with
teckit_compile DevRom.map
Copy the resulting file DevRom.tec somewhere xetex can find it and run texhash.
Usage sample:
\documentclass{standalone}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{sanskrit}
\usepackage{xltxtra}
\usepackage{fontspec}
\setmainfont{Gentium}
\newfontfamily\devanagarifont[Script=Devanagari]{nakula.ttf}
\newfontfamily\devtransl[Script=Roman,Mapping=DevRom]{Gentium}
\begin{document}
\def\devanagarisample{%
उदु ज्योतिरमृतं विश्वजन्यं विश्वानरः सविता देवो अश्रेत् ।
क्रत्वा देवानामजनिष्ट चक्षुराविरकर्भुवनं विश्वमुषाः ॥ १ ॥
प्र मे पन्था देवयाना अदृश्रन्नमर्धन्तो वसुभिरिष्कृतासः ।
अभूदु केतुरुषसः पुरस्तात्प्रतीच्यागादधि हर्म्येभ्यः ॥ २ ॥
}
%\devscript
\noindent\textsanskrit\devanagarisample
\devtransl
\noindent\devanagarisample
\end{document}
Output:

Important lines are
\newfontfamily\devanagarifont[Script=Devanagari]{nakula.ttf}
\newfontfamily\devtransl[Script=Roman,Mapping=DevRom]{Gentium}
where we define font command for print devanagari using polyglossia and command for printing of the transliteration.
If you want output using another transliteration method, you can easily adjust map method yourself there are lines in the form
U+093D <> U+0027 ;unstyled apostrophe
where is the input code, then output code and comment after the semicolon. Just swap input and output code.