# XML: Select only certain "nodes"?

**URL:** <https://forum.kirupa.com/t/xml-select-only-certain-nodes/320081>\
**Category:** flash\
**Created:** [March 13, 2011, 7:50pm UTC](https://forum.kirupa.com/t/xml-select-only-certain-nodes/320081 "2011-03-13T19:50:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sufire](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@sufire](https://forum.kirupa.com/u/sufire)\
**Post date:** [March 13, 2011, 7:50pm UTC](https://forum.kirupa.com/t/xml-select-only-certain-nodes/320081/1 "2011-03-13T19:50:53Z")

</div>

Here is my XML. I have removed A LOT of what is actually in the XML file I am working with, for simplicity:

```php
<State>
  <Center ID="BOCC">
    <Dispatch>
      <Log>
        <LogType>Traffic Collision - Ambulance Responding</LogType>
      </Log>
      <Log>
        <LogType>Traffic Hazard</LogType>
      </Log>
      <Log>
        <LogType>Pedestrian On A Highway</LogType>
      </Log>
    </Dispatch>
  </Center>
  <Center ID="SOMEOTHERCENTER">
    <Dispatch>
      <Log>
        <LogType>Possible Fatality</LogType>
      </Log>
      <Log>
        <LogType>Cargo or Hazardous Materials Spill</LogType>
      </Log>
      <Log>
        <LogType>Pedestrian On A Highway</LogType>
      </Log>
    </Dispatch>
  </Center>
</State>

```

I need ONLY the text of the LogType’s (FROM CENTER “BOCC” ONLY) to show up in a list component or trace the output… doesn’t matter… I can formulate it myself… I just need to only grab this specific data. I do not want to see any other results (e.g. from SOMEOTHERCENTER). Like show:

Traffic Collision - Ambulance Responding  
Traffic Hazard  
Pedestrian On A Highway

The actual file I’m working with (and can not alter) is [http://media.chp.ca.gov/sa\_xml/sa.xml](http://media.chp.ca.gov/sa_xml/sa.xml).
