Streaming API:
xmlReader and xmlWriter have a very
small memory footprint, only enough for the state information of the
XML parser, and in the case of xmlReader, the current
element. The memory consumed stays relatively constant, regardless
of the size of the XML document being dealt with.
Tree API:
xmlTree interface holds the entire tree in memory,
and requires around 4 times the size of the XML document. For
example, the XML-1.0 recommendation is about 150KB and, when
parsed, uses around 650KB of memory.