public static function removeFormatting($xml)
	{
		$dom   = self::loadXML($xml);
		$xpath = new DOMXPath($dom);
		foreach ($xpath->query('//e | //s') as $node)
		{
			$node->parentNode->removeChild($node);
		}

		return $dom->documentElement->textContent;
	}
public static function removeFormatting($xml)
	{
		$dom   = self::loadXML($xml);
		$xpath = new DOMXPath($dom);
		foreach ($xpath->query('//e | //s') as $node)
		{
			$node->parentNode->removeChild($node);
		}

		return $dom->documentElement->textContent;
	}
public static function removeFormatting ( $ xml ) { $ dom = self :: loadXML ( $ xml ) ; $ xpath = new DOMXPath ( $ dom ) ; foreach ( $ xpath -> query ( '//e | //s' ) as $ node ) { $ node -> parentNode -> removeChild ( $ node ) ; } return $ dom -> documentElement -> textContent ; }
Strip the formatting of an intermediate representation and return plain text

This will remove start tags and end tags but will keep the text content of everything else

@param  string $xml Intermediate representation
@return string      Plain text
Strip the formatting of an intermediate representation and return plain text