xml - XPath Help Required -


i need figuring out xpath expressions locate specific information xml excerpt.

<?xml version="1.0"?> <!doctype example example "example.dtd"> <example mode="server">     <listen>         <address>9.21.1.33</address>         <address>9.4.43.207</address>         <port proto="tcp">9786</port>     </listen>     <max-clients>16</max-clients>     <turn-clock unit="seconds">40</turn-clock> </example> 

then trying figure out following:

  1. the set of address elements
  2. the value of unit attribute of turn-clock element
  3. the mode attribute of root element
  4. the value of second example element
  5. the value of max-clients element

  1. //address
  2. //turn-clock/@unit
  3. //@mode
  4. //turn-clock/text()
  5. //max-clients/text()