\Header{xmlRoot}{Get the top-level XML node.}
\methalias{xmlRoot.XMLDocument}{xmlRoot}
\methalias{xmlRoot.XMLDocumentContent}{xmlRoot}
\methalias{xmlRoot.XMLDocumentRoot}{xmlRoot}
\keyword{file}{xmlRoot}
\begin{Description}\relax
These are a collection of methods for providing easy access to the
top-level \code{XMLNode} object resulting from parsing an XML
document.  They simplify accessing this node in the presence of
auxillary information such as DTDs, file name and version information
that is returned as part of the parsing.
\end{Description}
\begin{Usage}
\begin{verbatim}
xmlRoot(x, ...)
xmlRoot.XMLDocumentContent(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] the object whose root/top-level XML node is to be returned.
\item[\code{...}] arguments that are passed by the generic to the different specialized 
methods of this generic.
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{XMLNode}.
\end{Value}
\begin{Note}\relax
One cannot obtain the parent or top-level node
of an XMLNode object in S. This is different from 
languages like C, Java, Perl, etc. and is primarily 
because S does not provide support for references.
\end{Note}
\begin{Author}\relax
Duncan Temple Lang
\end{Author}
\begin{References}\relax
\url{http://www.w3.org/XML}, \url{http://www.jclark.com/xml},
\url{http://www.omegahat.org}
\end{References}
\begin{SeeAlso}\relax
\code{\Link{xmlTreeParse}}
\code{\Link{[[.XMLNode}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
  xmlRoot(doc)
\end{ExampleCode}
\end{Examples}

