Answer:
It's inherited from a person's parents. The parent may not have the disorder but could be a carrier of the mutation in the X chromosome that causes it.
Also while unlikely a mutation in a mothers egg cells could cause it to develop in the child, without the mother possessing the gene.