# Xpath.class.php (help on php XPATH)

**URL:** https://forum.kirupa.com/t/xpath-class-php-help-on-php-xpath/221540
**Category:** programming
**Created:** [April 5, 2007, 12:04am UTC](https://forum.kirupa.com/t/xpath-class-php-help-on-php-xpath/221540 "2007-04-05T00:04:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![joran420](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joran420/32/2329_2.png) [@joran420](https://forum.kirupa.com/u/joran420)
#### Post date: [April 5, 2007, 12:04am UTC](https://forum.kirupa.com/t/xpath-class-php-help-on-php-xpath/221540/1 "2007-04-05T00:04:58Z")

</div>

im using the XPath.class.php Xpath class for php

If figured out how to select a single data item…but how do i select multiple nodes

```auto

<xml>
   <news>
        <headline>headline1</headline>
        <content>this is news1</content>
   </news>
   <news>
        <headline>headline2</headline>
        <content>this is news2</content>
   </news>
    <news>
        <headline>headline3</headline>
        <content>this is news3</content>
   </news>
</xml>

```

how would i create an array of all the headlines? with XPath.class.php

or if someone knows of a better way to handle XML in php…
