<?php
/**
* Created by PhpStorm.
*/
//1.
$xml1 = "<root><node1>shrimpking content</node1></root>";
$sxe1 = new SimpleXMLElement($xml1);
//2.
$xml2 = "<root><node1>shrimpking content</node1></root>";
$sxe2 = simplexml_load_string($xml2);
//3.
$sxe3 = simplexml_load_file('xml1.xml');
2.xml
<?xml version="1.0" encoding="GB2312" ?>
<root>
<node1>shrimpking content</node1>
</root>