Fix TypeError when child[‘@attributes’] is undefined.
Update deprecated attribute.nodeValue to attribute.value