Apex provides classes that enable you to work with XML content using the DOM and DOM represents an XML document as a hierarchy of nodes. Some nodes may be branch nodes and have child nodes, while others are leaf nodes with no children. You can parse nested XML content that’s up to 50 nodes deep. DOM classes help you parse or generate XML content.