令test.xml为
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ProjectInvest>
<Project>
<Id>Service4</Id>
<name>SoapService</name>
<Participate>
<Employee>
<Name>鍏板叞</Name>
<PrtDrgree>2003-12-03</PrtDrgree>
</Employee>
<Employee>
<Name>缂曠紩</Name>
<PrtDrgree>2003-10-28</PrtDrgree>
</Employee>
</Participate>
</Project> <Project>
<Id>PROMNG_TEST</Id>
<name>Manager</name>
<CutomerName>鍐呴儴</CutomerName>
<Period>2003-10-01</Period>
<Participate>
<Employee>
<Name>纰岀</Name>
<PrtDrgree>2003-10-01</PrtDrgree>
</Employee>
<Employee>
<Name>缂撶紦</Name>
<PrtDrgree>2003-10-29</PrtDrgree>
</Employee>
</Participate>
</Project>
</ProjectInvest>test.php
<?php
$boardname = realpath("test.xml");
$doc = xmldocfile($boardname);
$conn = xpath_new_context($doc);
$found = xpath_eval($conn, "//Name");
$result = $found->nodeset;
foreach($result as $node) {
  $v = $node->children();
  echo iconv("UTF-8","GB2312",$v[0]->content)."<br>";
}
?>