如何使用php从xml格式工具中获取xml文档中的特定标记

I am trying to get specific tags from myxmlfile, and I want those tags to be in an xml format. Here is the code that i have tried so far but am still missing something.

<?php

$xml = simplexml_load_file('MyXmlFile.xml');

$result = $xml->xpath('/Batch/Commands/Command');

while(list( , $node) = each($result)) {
    echo $node->asXML('two.xml');
}