when I try to access data in the object echo $myxml->aaa-list; // return 0 "incorrect" I have to use $mylist = "aaa-list"; echo $myxml->$mylist; // return correct result How can I correct this line to get the answer? echo $myxml->aaa-list; Thank you.