Symfony DomCrawler get HTML without attributes / styles

  domcrawler, symfony

I need a way to get a HTML from an email without attributes (class / styles).

Currently trying the following:

$crawler = new Crawler();

$html = '';
$nodes = $crawler->filter('body > *'); //only stuff inside body

foreach ($crawler as $domElement) {
    //remove somehow class+styles ?
    $html .= $domElement->ownerDocument->saveHTML($domElement);

echo $html; //outputs everything inside body (currently with attributes)

As I read on many questions already, regex is not a good solutions for something like this as it may break stuff.

Source: Symfony Questions