\Header{newXMLDoc}{Create internal XML node or document object}
\alias{newXMLNode}{newXMLDoc}
\keyword{IO}{newXMLDoc}
\begin{Description}\relax
These are used to create internal `libxml' nodes
and top-level document objects 
that are used to write XML trees.
While the functions are available,
their direct use is not encouraged.
Instead, use \code{\Link{xmlTree}}
as the functions need to be 
used within a strict regime
to avoid corrupting C level structures.
\end{Description}
\begin{Usage}
\begin{verbatim}
newXMLDoc(dtd, namespaces=NULL)
newXMLNode(name, ..., attrs = NULL, namespace="", doc=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{dtd}] the name of the DTD to use for the XML document.
\item[\code{namespaces}] a named character vector
with each element specifying a name space identifier and the
corresponding URI for that namespace
that are to be declared and used in the XML document, \bsl{}
e.g. \code{c(shelp = "http://www.omegahat.org/XML/SHelp")}
\item[\code{name}] the tag/element name for the XML node
\item[\code{...}] the children of this node. These can be other nodes created
earlier or R strings that are converted to text nodes and added as children
to this newly created node.
\item[\code{attrs}] a named list of name-value pairs to be used as 
attributes for the XML node.
\item[\code{namespace}] the short or alias for the namespace to use for
this XML node
\item[\code{doc}] the \code{XMLInternalDocument} object created with
\code{newXMLDoc} that is used to root the node.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These create internal C level objects/structure instances
that can be added to a libxml DOM and subsequently
inserted into other document objects or ``serialized''
to textual form.
\end{Details}
\begin{Value}
Each function returns an R object that points to the
C-level structure instance.
These are of class \code{XMLInternalDocument}
and \code{XMLInternalNode}, respectively
\end{Value}
\begin{Note}\relax
These functions are used to build up an internal XML tree.
This can be used in the Sxslt package (\url{http://www.omegahat.org/Sxslt})
when creating content in R that is to be dynamicall inserted into an XML
document.
\end{Note}
\begin{Author}\relax
Duncan Temple Lang
\end{Author}
\begin{References}\relax
\url{http://www.w3.org/XML}, \url{http://www.xmlsoft.org},
\url{http://www.omegahat.org}
\end{References}
\begin{SeeAlso}\relax
\code{\Link{xmlTree}}
\code{saveXML}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

\end{ExampleCode}
\end{Examples}

