私のxmlドキュメントは次のようになります..(実際にはGoogleマップのkmlファイルです..)
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<Name>Folder1</Name>
<Placemark>
<Name>Placemark1Folder1</Name>
<LookAt>
<longitude>-122.0839597145766</longitude>
<latitude>37.42222904525232</latitude>
</LookAt>
</Placemark>
<Placemark>
<Name>Placemark2Folder1</Name>
<LookAt>
<longitude>-101.083959</longitude>
<latitude>26.422</latitude>
</LookAt>
</Placemark>
</Folder>
<Folder>
<Name>Folder2</Name>
<Placemark>
<Name>Placemark1Folder2</Name>
<LookAt>
<longitude>-96.566556</longitude>
<latitude>14.422</latitude>
</LookAt>
</Placemark>
</Folder>
</Document>
</kml>
各フォルダノードの各目印に従って、次のような個別のxmlファイルを作成したいと思います
最初の XML:
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<Name>Folder1</Name>
<Placemark>
<Name>Placemark1Folder1</Name>
<LookAt>
<longitude>-122.0839597145766</longitude>
<latitude>37.42222904525232</latitude>
</LookAt>
</Placemark>
</Folder>
</Document>
</kml>
2番目のxml
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<Name>Folder1</Name>
<Placemark>
<Name>Placemark2Folder1</Name>
<LookAt>
<longitude>-101.083959</longitude>
<latitude>26.422</latitude>
</LookAt>
</Placemark>
</Folder>
</Document>
</kml>
3番目のxml
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<Name>Folder2</Name>
<Placemark>
<Name>Placemark1Folder2</Name>
<LookAt>
<longitude>-96.566556</longitude>
<latitude>14.422</latitude>
</LookAt>
</Placemark>
</Folder>
</Document>
</kml>
..私はxmlの初心者です..助けてください