I have a big xml structure. I am interested in certain xml structure like below. I need to extract img tags only and the value of the src attribute if they are inside coral-card
This is exactly why the core DOM specification was created:
// Find all the elements:
var elements = document.getElementsByTagName("coral-card");
// Loop through them:
for(var i = 0; i < elements.length; ++i){
// Extract whatever you need:
console.log(elements[i].getAttribute("variant"));
console.log(elements[i].querySelector("img").src);
}