def get_pStyle(p, doc):
    """
    Get the referenced style element for a paragraph with a p.pPr.pStyle
    """
    if p.pPr is not None and p.pPr.pStyle is not None:
        return doc.styles.element.find("w:style[@w:styleId='%s']" % p.pPr.
            pStyle.val, doc.styles.element.nsmap)
    return None
