# AS handling XML empty elements

**URL:** <https://forum.kirupa.com/t/as-handling-xml-empty-elements/292853>\
**Category:** flash\
**Created:** [July 20, 2009, 2:34pm UTC](https://forum.kirupa.com/t/as-handling-xml-empty-elements/292853 "2009-07-20T14:34:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratmack](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@stratmack](https://forum.kirupa.com/u/stratmack)\
**Post date:** [July 20, 2009, 2:34pm UTC](https://forum.kirupa.com/t/as-handling-xml-empty-elements/292853/1 "2009-07-20T14:34:53Z")

</div>

I’ve got a fairly simple flash app that searches an xml file and returns text listings of the content of the childnodes back to a dynamic text box for display. The xml file will be edited and managed by an outside user. It works great but if there’s an empty childnode (element) it comes back in the list as undefined. I’d like to be able to leave the xml element format the same for the user whether it has text inside the element or not. If it’s left empty though, I don’t want it to show up. I’ve seen several ideas on how to handle this but was wondering what the best and most simple solution is. Thanks in advance.
