An XML processor takes an XML document and DTD file as input and processes them so that applications can access the information. There are two main API approaches for XML processors - SAX and DOM. SAX is an event-based approach where the processor signals events to the application as it recognizes syntactic structures. DOM builds a hierarchical tree of the document in memory that can then be randomly accessed by applications. SAX is faster but DOM allows random access and rearranging of the document.