Q:

XPATH How to Select two specific chidren from a same parent

Good night, friends!
Lets suppose we have a xml with 30 items like that and I want to get just the name and url from an item where name contains the word: Richard. 
<channel>
    <item>
      <name>Brian</name>
      <lastname>Connor</lastname>
      <age>40</age>
      <enclosure url="http://www.brian.com"/>
    </item>
    <item>
      <name>Richard</name>
      <lastname>Wendell</lastname>
      <age>38</age>
      <enclosure url="http://www.richard.com"/>
    </item>
</channel>

How can I do that using XPath?
I tried:
"//channel/item[name[contains(text(),'Richard')]]" but it returns just the name and I don't know how to select the url information together.
Please excuse my english!

A:

Your approach does not work because you are selecting a sub tree (in this case an item) of the XML tree which contains more information than you want. If you want just a subset of the attributes in ONE xpath expression you have to select them separately and then concatenate them adequately, e.g.
concat('name=', //channel/item[contains(name, 'Richard')]/name, ' url=', //channel/item[contains(name, 'Richard')]/enclosure/@url)

The example will allow you to alter the additional formatting easily.
By the way: your XML input was malformatted. I corrected this.

