What are some potential pitfalls when using the DOMDocument class in PHP for XML processing?

One potential pitfall when using the DOMDocument class in PHP for XML processing is memory consumption, especially when dealing with large XML files. To mitigate this issue, it's important to free up memory by explicitly calling the `unset()` function on the DOMDocument object after processing the XML data.

// Load XML file
$xml = new DOMDocument();
$xml->load('example.xml');

// Process XML data

// Free up memory
unset($xml);