addChild("token", $token); $xmla->asXML('../db/todoist.xml'); echo "ok"; } else if (isset($_POST['name']) && isset($_POST['id'])) { $name = trim($_POST['name']); $id = trim($_POST['id']); $xmla->addChild("name", $name); $xmla->addChild("id", $id); $xmla->asXML('../db/todoist.xml'); echo "ok"; }