protected function _stripAttributes($node = null)
{
foreach ($node->childNodes as $childNode) {
if ($childNode->nodeType === XML_ELEMENT_NODE) {
foreach ($childNode->attributes as $attributeName => $attributeNode) {
if (!in_array($attributeName, $this->_allowedAttributes)) {
$childNode->removeAttribute($attributeName);
}
}
/* strip children attributes */
if ($childNode->hasChildNodes()) {
$this->_stripAttributes($childNode);
}
}
}
return $node;
}