I have an XML as:
  1.  <a>  
  2.    <b>  
  3.       <c>  
  4.             <source>   
  5.                   <title value ="Apple"/>   
  6.                      some more tags  
  7.                      .  
  8.                      .  
  9.                      .   
  10.             source>  
  11.                     
  12.                   <source>  
  13.                         <title value ="Mango"/>  
  14.                            some more tags  
  15.                               .  
  16.                               .  
  17.                               .  
  18.                    source>  
  19.    
  20.                   <source>  
  21.                         <title value ="Banana"/>  
  22.                               some more tags  
  23.                               .  
  24.                               .  
  25.                               .  
  26.                   source>  
  27.                     
  28.                <source>  
  29.                   <title value =" Grapes"/>  
  30.                      <some more tags>  
  31.                         .  
  32.                         .  
  33.                         .  
  34.                source>  
  35. c>  
  36. b>  
  37. a>   
Based on my input(supose if my input is "title = Banana" I want to display all info related that tag.
 
I want to display the selected and related <tags> values under that.</div><div> </div><div id="pastingspan1">eg: Mango, Banana</div><div> </div><div id="pastingspan1"> </div><div id="pastingspan1"> </div><div id="pastingspan1">XSLT :</div><div id="pastingspan1"> </div><div id="pastingspan1"></div><div class="dp-highlighter"><div class="bar"></div><ol start="1" class="dp-xml"><li class="alt"><span><span class="tag"><</span><span class="tag-name">xsl:template</span><span> </span><span class="attribute">match</span><span>=</span><span class="attribute-value">"/"</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">html</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">body</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">xsl:apply-templates</span><span> </span><span class="attribute">select</span><span>=</span><span class="attribute-value">"source"</span><span class="tag">/></span><span>  </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">body</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"></</span><span class="tag-name">html</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">xsl:template</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">xsl:template</span><span> </span><span class="attribute">match</span><span>=</span><span class="attribute-value">"source"</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">xsl:choose</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">xsl:when</span><span> </span><span class="attribute">test</span><span>=</span><span class="attribute-value">"source[@value='Banana']"</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">xsl:value-of</span><span> </span><span class="attribute">select</span><span>=</span><span class="attribute-value">"source[@value='Banana']"</span><span class="tag">/></span><span>  </span></span></li><li class=""><span><span class="tag"></</span><span class="tag-name">xsl:when</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">xsl:otherwise</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">xsl:value-of</span><span> </span><span class="attribute">select</span><span>=</span><span class="attribute-value">"$untitled_section"</span><span class="tag">/></span><span>  </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">xsl:otherwise</span><span class="tag">></span><span>  </span></span></li><li class=""><span><span class="tag"></</span><span class="tag-name">xsl:choose</span><span class="tag">></span><span>  </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">xsl:template</span><span class="tag">></span><span>  </span></span></li></ol></div><div id="pastingspan1"> </div><div id="pastingspan1"> </div><div id="pastingspan1">Desire HTML output:</div><div> </div><div id="pastingspan1"> </div><div id="pastingspan1">Banana </div><div id="pastingspan1"> </div><div id="pastingspan1"> (some more tags deatils)......</div><div id="pastingspan1">(some more tags deatils)......</div><div id="pastingspan1">(some more tags deatils)......</div><div id="pastingspan1">(some more tags deatils)......</div><div id="pastingspan1">(some more tags deatils)...... </div></div></article><section class="comments" id="replies"><header class="comments-head"><span class="comments-badge" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3 3h10a2 2 0 0 1 2 2v4.5a2 2 0 0 1-2 2H7.5L4 14.5V11.5H3a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"></path></svg></span><div><h2 class="comments-title">2 Replies</h2><p class="comments-sub">Know the answer? Post it — somebody with the same question will find it here.</p></div></header><div class="comment-signin"><span class="comment-signin-badge" aria-hidden="true"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M11.5 3.5h3.2a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-3.2" stroke-linecap="round"></path><path d="M4.5 10h7" stroke-linecap="round"></path><path d="M8.8 7.2 11.6 10l-2.8 2.8" stroke-linecap="round" stroke-linejoin="round"></path></svg></span><div class="comment-signin-body"><p class="comment-signin-title">Sign in to <!-- -->answer this question</p><p class="comment-signin-text">It is the same account you read, post and publish with — and you will come straight back to this page.</p></div><div class="comment-signin-actions"><a class="btn primary-btn comment-signin-btn" href="/login?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt">Sign in</a><a class="comment-signin-alt" href="/register?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt">Create an account</a></div></div><ul class="comment-list"><li class="comment-thread"><article class="comment"><a class="comment-photo-link" href="/members/manoj-bhoir2" title="Manoj Bhoir"><img class="comment-photo" src="https://cdn.c-sharpcorner.com/uploadfile/authorimage/0cefc420150507114342.webp" alt="Manoj Bhoir" title="Manoj Bhoir" loading="lazy" data-avatar-name="Manoj Bhoir" referrerPolicy="no-referrer"/></a><div class="comment-main"><div class="comment-head"><p class="comment-byline"><a href="/members/manoj-bhoir2" class="comment-author">Manoj Bhoir</a><span class="posted-when" tabindex="0"><time class="posted-when-value comment-time" dateTime="2019-05-17T23:41:37.740Z">7y<!-- --> ago</time><span class="posted-when-pop" role="tooltip"><span>Posted<!-- --> <!-- -->May 17, 2019, 11:41 PM</span></span></span></p></div><div class="article-body"><div>Hi,</div><div> </div><div>Check this article. This will help you.</div><div> </div><div>https://www.c-sharpcorner.com/UploadFile/manas1/display-xml-data-as-html-using-xslt-in-Asp-Net/</div></div><div class="comment-foot"><span class="reply-vote"><a href="/login?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt" class="reply-vote-btn reply-vote-up" title="Sign in to vote up" aria-label="Vote up"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 2.5 14.5 12h-13z"></path></svg></a><span class="reply-vote-score" title="0 up, 0 down">0</span><a href="/login?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt" class="reply-vote-btn reply-vote-down" title="Sign in to vote down" aria-label="Vote down"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 13.5 1.5 4h13z"></path></svg></a></span></div></div></article></li><li class="comment-thread"><article class="comment"><a class="comment-photo-link" href="/members/bryian-tan3" title="Bryian Tan"><img class="comment-photo" src="https://cdn.c-sharpcorner.com/uploadfile/authorimage/bryiantan.webp" alt="Bryian Tan" title="Bryian Tan" loading="lazy" data-avatar-name="Bryian Tan" referrerPolicy="no-referrer"/></a><div class="comment-main"><div class="comment-head"><p class="comment-byline"><a href="/members/bryian-tan3" class="comment-author">Bryian Tan</a><span class="posted-when" tabindex="0"><time class="posted-when-value comment-time" dateTime="2019-05-17T23:20:37.180Z">7y<!-- --> ago</time><span class="posted-when-pop" role="tooltip"><span>Posted<!-- --> <!-- -->May 17, 2019, 11:20 PM</span></span></span></p></div><div class="article-body"><div>What do you mean by</div><div> </div><div> <some more tags><div>                         .</div><div>                         .</div><div>                         . </div> </div></div><div class="comment-foot"><span class="reply-vote"><a href="/login?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt" class="reply-vote-btn reply-vote-up" title="Sign in to vote up" aria-label="Vote up"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 2.5 14.5 12h-13z"></path></svg></a><span class="reply-vote-score" title="0 up, 0 down">0</span><a href="/login?returnurl=%2Fforums%2Ftransformation-of-xml-to-html-using-xslt" class="reply-vote-btn reply-vote-down" title="Sign in to vote down" aria-label="Vote down"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 13.5 1.5 4h13z"></path></svg></a></span></div></div></article></li></ul></section></div></div><script>$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("S:2","P:2")</script><script>$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0}; $RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};$RC("B:1","S:1")</script><div hidden id="S:3"></div><script>$RC("B:3","S:3")</script><div hidden id="S:0"></div><script>$RC("B:0","S:0")</script></body></html>