I am retrieving XML files like the one at the end of this post. I can use
xmlParse to create the object and retrieve elements. However I need to be able
to loop through this page and enter the text into a database. This would work
except there are not the same number of elements everytime (i.e. sometimes
there is no street address) so when I go through my loop and try to reference
that element it does not exist and throws an error. How do I check and see if
there is an element there before I reference it? Or, is there a better way to
do this? Thanks!

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <RESULTS>
- <INFO>
<VERSION>1.6</VERSION>
<STATUS>OK</STATUS>
<SEARCH_ID>2034388388</SEARCH_ID>
<SEARCH_TYPE>Find_Business</SEARCH_TYPE>
<COUNT>8</COUNT>
</INFO>
- <LISTINGS>
- <LISTING>
- <NAME>
<BUS>Choral Guild Of Atlanta</BUS>
</NAME>
- <ADDRESS>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30303</ZIP>
</ADDRESS>
<PHONE>4042236362</PHONE>
</LISTING>
+ <LISTING>
- <NAME>
<BUS>Guild Group The</BUS>
</NAME>
- <ADDRESS>
<NUM>2000</NUM>
<STREET>Powers Ferry</STREET>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30303</ZIP>
</ADDRESS>
<PHONE>7709897484</PHONE>
</LISTING>
- <LISTING>
- <NAME>
<BUS>Guild Quality</BUS>
</NAME>
- <ADDRESS>
<NUM>1425</NUM>
<STREET>Ellsworth Industrial Blvd NW</STREET>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30318</ZIP>
</ADDRESS>
<PHONE>4043559223</PHONE>
</LISTING>
- <LISTING>
- <NAME>
<BUS>Gwinnett Coral Guild</BUS>
</NAME>
- <ADDRESS>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30303</ZIP>
</ADDRESS>
<PHONE>4042239962</PHONE>
</LISTING>
- <LISTING>
- <NAME>
<BUS>High Museum Of Art</BUS>
</NAME>
- <LISTING>
- <NAME>
<BUS>Departments</BUS>
</NAME>
- <LISTING>
- <NAME>
<BUS>Members Guild</BUS>
</NAME>
- <ADDRESS>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30303</ZIP>
</ADDRESS>
<PHONE>4047334428</PHONE>
</LISTING>
</LISTING>
</LISTING>
- <LISTING>
- <NAME>
<BUS>McGavren Guild Radio</BUS>
</NAME>
- <ADDRESS>
<NUM>400</NUM>
<STREET>Interstate North Pkwy SE</STREET>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30339</ZIP>
</ADDRESS>
<PHONE>7709531111</PHONE>
</LISTING>
- <LISTING>
- <NAME>
<BUS>Screen Actors Guild</BUS>
</NAME>
- <ADDRESS>
<NUM>3340</NUM>
<STREET>Peachtree Rd NE</STREET>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30326</ZIP>
</ADDRESS>
<PHONE>4048125342</PHONE>
</LISTING>
- <LISTING>
- <NAME>
<BUS>Woodruff Arts Center</BUS>
</NAME>
- <LISTING>
- <NAME>
<BUS>High Museum Of Art</BUS>
</NAME>
- <LISTING>
- <NAME>
<BUS>1280 Peachtree St NE</BUS>
</NAME>
- <LISTING>
- <NAME>
<BUS>Members Guild</BUS>
</NAME>
- <ADDRESS>
<CITY>Atlanta</CITY>
<STATE>GA</STATE>
<ZIP>30303</ZIP>
</ADDRESS>
<PHONE>4047334428</PHONE>
</LISTING>
</LISTING>
</LISTING>
</LISTING>
</LISTINGS>
</RESULTS>