var childNodes = document.querySelector("div").childNodes, pickNext = false;
for(var i in childNodes) {
var childNode = childNodes[i];
if(pickNext) {
alert(childNode.nodeValue);
break;
}
// same as $(childNode).is("img")
// now you can put the XXXXXX where ever you want.
// as far as you know which is the next sibling.you can get it
if(childNode.nodeName === "IMG") {
pickNext = true;
}
}

by this way you can find the text anywhere it is as long as you know the sibling's node type.