The streaming API is limited in that it can read, or it can
write. The xmlReader and xmlWriter APIs are separate,
so there's no modifying XML that is being read with
xmlReader, and no looking back at data that's come out of
The streaming APIs are also linear - the xmlReader can
only examine the current element, meaning operations such as "get
the current element's parent" are impossible. Similarly, the
xmlWriter cannot change data that has already been send to
the API for writing.
XPath processing is also unavailable for the xmlReader
interface, since previous and future elements are not kept in memory
to be analyzed.
XSL Processing is unavailable for the xmlReader interface, as
XSL processing relies on random access and XPath expressions during
The tree API does not have these limitations. Because the
entire XML document is held in memory, data can be read and written
The tree can be accessed sequentially, randomly, or any desired
method. A tree could be constructed from the inside out, if so
XPath processing is available for the tree API, allowing for a
very easy, very powerful method of traversal for XML data.
XSL Processing is available for the tree API, allowing the
application of a stylesheet to produce XML or HTML data.