protected function _stripTags($node = null)
{
foreach ($node->childNodes as $childNode) {
if ($childNode->nodeType === XML_ELEMENT_NODE) {
if (!in_array($childNode->tagName, $this->_allowedTags)) {
$childNode->parentNode->removeChild($childNode);
}
/* strip children tags */
if ($childNode->hasChildNodes()) {
$this->_stripTags($childNode);
}
}
}
return $node;
}