Generally speaking, Javascript is executed on the client-side, in the web-browser.
On the other hand, PHP is executed on the server-side.
Quite often, you'll have to manipulate XML Documents on the server ; in these situations, you'll only have PHP, and will not be able to depend on a browser / on Javascript.
Except from where it's runing, There is not much difference between PHP and Javascript, when it comes to DOM manipulations -- which is a nice thing about DOM : it's quite standardized.
For example, you might want to generate an ATOM or RSS feed (which are XML) for the recent articles on a website ; this will be done on the server-side.
Another example would be a batch script that would process XML-files sent by a bank, every night, containing all payments for the last day ; for such a batch-process, there will be absolutly no browser.