Парсване на XML

AnyB1s

Registered
Здравейте,
възникна ми един проблем с парсване на един xml документ.

Имам следното съдържание

Код:
<books>
  <category id="action">
    <book>
        <name>Name of the book</name>
        <author>The author</author>
    </book>
     <book>
        <name>Name of the book</name>
        <author>The author</author>
    </book>
  </category>

 <category id="thriller">
    <book>
        <name>Name of the book</name>
        <author>The author</author>
    </book>
     <book>
        <name>Name of the book</name>
        <author>The author</author>
    </book>
  </category>
</books>

Въпроса ми е как да го парсна че да ми изведе резултатите по следния начин:
Код:
Action:
name of the book - author
Thriller:
name of the book - author

Благодаря предварително!
 

Back
Горе