import pathlib
from typing import List


def glob_xml_files(directory: pathlib.Path) -> List[pathlib.Path]:
    """Takes a path to a xml directory and returns a list containing all of the
        xml files in the directory.

        :param directory: directory to glob.
        :returns: List of file names.
        :raises: OSError
    """

    if directory.exists() and directory.is_dir():
        return [
            p for p in directory.glob("*.xml") if not p.name.startswith(".")
        ]

    else:
        raise OSError("Error: {} is not a directory".format(directory))