'); $comment = $xml->addChild('comment', 'This is a comment'); $comment->setText('Updated comment'); echo $xml->asXML(); ?>In this example, `SimpleXMLElement` class is used to create a new XML document. A new `comment` element is added using `addChild` and then its text is updated using `setText`. Package/Library: The `SimpleXMLElement` class is part of the PHP's built-in SimpleXML extension which is a library for working with XML documents in a simple way.