SAX (Simple API for XML) and DOM (Document Object Model) both provide programmatic access to XML documents, but differ in their approaches. SAX processes XML documents as a stream of parsing events rather than building an in-memory tree. It is great for linear processing of large XML documents. Unlike DOM, SAX can only be used for parsing existing documents in a stream, not for generating documents. SAX notifies a client program through events as it reads an XML document sequentially.