php bug?

[email protected] (mcberta2) Sun, 26 Sep 2010 09:36:35 +0200
Newsgroups php.xml.dev
Message-ID <[email protected]>
Hello everyone.
The following is an extract of a routine returning error messages from a 
xml file:

function title($index)
{
$xml = simplexml_load_file("lingo.xml");
return $xml->message[$index];
}

The problem is that if I call the routine with a value [ex. title(6)] I 
receive the message, whereas if I call the routine with a variable [ex. 
title($value) where $value=6] there is no way I can receive the message.

I tried in many different ways but it looks like it's a bug of simple_xml.
Have you found a way around?
Thank you for any input.