/** * @param DOMElement $element */ private function redeclare_xsi_type_namespace_definition(DOMElement $element) { $type = $element->getAttribute('xsi:type'); if (isset($type) && strpos($type, ':') !== false) { $parts = explode(':', $type, 2); $prefix = $parts[0]; $uri = $element->lookupNamespaceURI($prefix); $element->setAttribute('xmlns:' . $prefix, $uri); } }