Was Xianle a Separate Country?

Was Xianle a separate country to China? I know it's fictional, but I can't tell quite what it is. I don't know much about ancient China in general, much less its governmental structure, but I thought the only princes were in the imperial family? But Xie Lian's father definitely wasn't the emperor of China, only the king of Xianle, so was it something separate entirely, that happened to be near China? I know they got into a war with Yong An that seemed like a war between two countries. A war like that between two provinces would be... strange, wouldn't it? But I'm not sure... I'm very confused ^^; (Then again, I'm taking the Ming dynasty as a reference point. Maybe China's autocratic structure was different in some other centuries, and I got the time wrong?)