xml.*.(!hasOwnProperty('@valid') && parent().replace(childIndex(), ''));
xml.setChildren(xml.*.(hasOwnProperty('@valid')));