# How to display XML?

**URL:** https://forum.kirupa.com/t/how-to-display-xml/301298
**Category:** flash
**Created:** [December 7, 2009, 8:16am UTC](https://forum.kirupa.com/t/how-to-display-xml/301298 "2009-12-07T08:16:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lighteyes](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@lighteyes](https://forum.kirupa.com/u/lighteyes)
#### Post date: [December 7, 2009, 8:16am UTC](https://forum.kirupa.com/t/how-to-display-xml/301298/1 "2009-12-07T08:16:23Z")

</div>

Hello. I’m a beginner in XML. And I need help with this.

What I want to achieve is to display the XML data once I click the button. But I kept getting undefined error.

Here’s what I have:

t1.onRelease = function (){  
xmlDoc = loadXMLDoc(“bestofposts.xml”);  
x=xmlDoc.getElementsByTagName(“message”)[0].childNodes[0];  
subtopic = x.nodeValue;  
results\_txt.text = subtopic;  
};

Someone please help? ☹ I can’t seem to solve it.
